Bug 64906 - FcNameParse() should ignore leading whitespace in parameters
authorAkira TAGOH <akira@tagoh.org>
Fri, 24 May 2013 04:55:07 +0000 (13:55 +0900)
committerAkira TAGOH <akira@tagoh.org>
Fri, 24 May 2013 04:57:23 +0000 (13:57 +0900)
After this change, the following works as expected:
$ FC_DEBUG=4 fc-match ":family=foo bar, sans-serif"
...
FcConfigSubstitute Pattern has 3 elts (size 16)
        family: "foo bar"(s) "sans-serif"(s)
...

src/fcname.c

index 6dd4d49..a525345 100644 (file)
@@ -318,6 +318,12 @@ FcNameFindNext (const FcChar8 *cur, const char *delim, FcChar8 *save, FcChar8 *l
 
     while ((c = *cur))
     {
+       if (!isspace (c))
+           break;
+       ++cur;
+    }
+    while ((c = *cur))
+    {
        if (c == '\\')
        {
            ++cur;