diff options
Diffstat (limited to 'fontconfig/src/fcxml.c')
-rw-r--r-- | fontconfig/src/fcxml.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 5201b3c04..343208617 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -1848,7 +1848,11 @@ FcParseUnary (FcConfigParse *parse, FcOp op) static void FcParseDir (FcConfigParse *parse) { - const FcChar8 *attr, *data; +#ifdef _WIN32 + FcChar8 buffer[MAX_PATH]; +#endif + const FcChar8 *attr; + FcChar8 *data; FcChar8 *prefix = NULL; attr = FcConfigGetAttribute (parse, "prefix"); @@ -1886,7 +1890,7 @@ FcParseDir (FcConfigParse *parse) if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20)) { FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); - break; + goto bail; } /* * Must use the multi-byte aware function to search @@ -1905,7 +1909,7 @@ FcParseDir (FcConfigParse *parse) if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20)) { FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); - break; + goto bail; } p = _mbsrchr (data, '\\'); if (p) *p = '\0'; @@ -1919,7 +1923,7 @@ FcParseDir (FcConfigParse *parse) if (rc == 0 || rc > sizeof (buffer) - 20) { FcConfigMessage (parse, FcSevereError, "GetSystemWindowsDirectory failed"); - break; + goto bail; } if (data [strlen (data) - 1] != '\\') strcat (data, "\\"); |