]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcxml.c
Whitespace
[fontconfig.git] / src / fcxml.c
index e829422b318fc3fd35ae767a5dd54fc73a5fe4f8..0952b0b4424f30c967cdc975621945131d214fea 100644 (file)
@@ -57,6 +57,7 @@
 #define STRICT
 #include <windows.h>
 #undef STRICT
+#include <mbstring.h>
 #endif
 
 static void
@@ -132,18 +133,6 @@ FcExprCreateBool (FcConfig *config, FcBool b)
     return e;
 }
 
-static FcExpr *
-FcExprCreateNil (FcConfig *config)
-{
-    FcExpr *e = FcConfigAllocExpr (config);
-    if (e)
-    {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
-       e->op = FcOpNil;
-    }
-    return e;
-}
-
 static FcExpr *
 FcExprCreateField (FcConfig *config, const char *field)
 {
@@ -327,7 +316,7 @@ static const struct {
     { "config",                FcElementConfig },
     { "match",         FcElementMatch },
     { "alias",         FcElementAlias },
-    
+
     { "blank",         FcElementBlank },
     { "rescan",                FcElementRescan },
 
@@ -2059,7 +2048,13 @@ FcEndElement(void *userData, const XML_Char *name)
                        FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed");
                        break;
                }
-               p = strrchr (data, '\\');
+               /*
+                * Must use the multi-byte aware function to search
+                * for backslash because East Asian double-byte code
+                * pages have characters with backslash as the second
+                * byte.
+                */
+               p = _mbsrchr (data, '\\');
                if (p) *p = '\0';
                strcat (data, "\\fonts");
        }
@@ -2072,7 +2067,7 @@ FcEndElement(void *userData, const XML_Char *name)
                        FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed");
                        break;
                }
-               p = strrchr (data, '\\');
+               p = _mbsrchr (data, '\\');
                if (p) *p = '\0';
                strcat (data, "\\..\\share\\fonts");
        }
@@ -2080,7 +2075,11 @@ FcEndElement(void *userData, const XML_Char *name)
        {
            int rc;
            data = buffer;
+#if _WIN32_WINNT >= 0x0500
            rc = GetSystemWindowsDirectory (buffer, sizeof (buffer) - 20);
+#else
+           rc = GetWindowsDirectory (buffer, sizeof (buffer) - 20);
+#endif
            if (rc == 0 || rc > sizeof (buffer) - 20)
            {
                FcConfigMessage (parse, FcSevereError, "GetSystemWindowsDirectory failed");