2 ===================================================================
3 --- src/fccfg.c (revision 92)
4 +++ src/fccfg.c (revision 99)
10 +#define getenv(x) NULL
14 #if defined (_WIN32) && !defined (R_OK)
18 /* If no home, use the temp folder. */
20 - int templen = GetTempPath (1, dummy);
21 + int templen = GetTempPathA (1, dummy);
22 FcChar8 *temp = malloc (templen + 1);
28 - GetTempPath (templen + 1, temp);
29 + GetTempPathA (templen + 1, temp);
30 cache_dir = FcStrPlus (temp, FC_USER_CACHE_FILE);
32 if (!FcConfigSetCache (config, cache_dir))
34 char *home = getenv ("HOME");
38 + return FONTCONFIG_PATH;
41 home = getenv ("USERPROFILE");
44 ===================================================================
45 --- src/fcxml.c (revision 92)
46 +++ src/fcxml.c (revision 99)
47 @@ -1704,9 +1704,17 @@
51 - if (strcmp (data, "WINDOWSFONTDIR") == 0)
52 + if (strcmp (data, "WINDOWSFONTDIR") == 0 || strcmp (data, "BINDIR") == 0)
55 + enum dirtype_e {WINDOWSFONTDIR, BINDIR};
56 + enum dirtype_e dirtoken;
58 + if (strcmp (data, "WINDOWSFONTDIR") == 0)
59 + dirtoken = WINDOWSFONTDIR;
60 + else if (strcmp (data, "BINDIR") == 0)
66 @@ -1715,16 +1723,35 @@
69 FcMemAlloc (FC_MEM_STRING, 1000);
70 - rc = GetWindowsDirectory (data, 800);
71 - if (rc == 0 || rc > 800)
72 + if (dirtoken == BINDIR)
74 - FcConfigMessage (parse, FcSevereError, "GetWindowsDirectory failed");
78 + rc = GetModuleFileName (NULL, data, 800);
79 + if (rc == 0 || rc > 800)
81 + FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed");
85 + p = strrchr (data, '\\');
91 - if (data [strlen (data) - 1] != '\\')
92 - strcat (data, "\\");
93 - strcat (data, "fonts");
94 + else /* WINDOWSFONTDIR */
96 + rc = GetWindowsDirectory (data, 800);
97 + if (rc == 0 || rc > 800)
99 + FcConfigMessage (parse, FcSevereError, "GetWindowsDirectory failed");
103 + if (data [strlen (data) - 1] != '\\')
104 + strcat (data, "\\");
105 + strcat (data, "fonts");
109 if (!FcStrUsesHome (data) || FcConfigHome ())
111 ===================================================================
112 --- Makefile.am (revision 92)
113 +++ Makefile.am (revision 99)
115 config_DATA=fonts.conf fonts.dtd
118 - $(mkinstalldirs) $(DESTDIR)/$(configdir)
119 + $(mkinstalldirs) $(DESTDIR)$(configdir)
120 if [ -f $(DESTDIR)$(configdir)/local.conf ]; then \
121 echo "not overwriting existing $(DESTDIR)$(configdir)/local.conf"; \
122 else if [ -f $(srcdir)/local.conf ]; then \