patch: fc-cache should not stop at the first non existing directory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently fc-cache stops at the first directory listed
in /etc/fonts/fonts.conf which doesn't exist and does not
continue to created caches for the other directories which may exist.

If for example "/usr/share/fonts" is the first directory in
/etc/fonts/fonts.conf and this directory doesn't exist (move it out of
the way for testing), fc-cache immediately returns and says
"succeeded" although it didn't create any caches.

Patch attched.

diff -ru fontconfig-2.3.93.20060130.orig/fc-cache/fc-cache.c fontconfig-2.3.93.20060130/fc-cache/fc-cache.c
--- fontconfig-2.3.93.20060130.orig/fc-cache/fc-cache.c	2006-01-27 11:10:26.000000000 +0100
+++ fontconfig-2.3.93.20060130/fc-cache/fc-cache.c	2006-01-30 21:32:52.000000000 +0100
@@ -113,6 +113,7 @@
 {
     int		ret = 0;
     const FcChar8 *dir;
+    const FcChar8 *dir_orig;
     FcFontSet	*set;
     FcStrSet	*subdirs;
     FcStrList	*sublist;
@@ -122,17 +123,24 @@
      * Now scan all of the directories into separate databases
      * and write out the results
      */
-    while ((dir = FcStrListNext (list)))
+    while ((dir_orig = FcStrListNext (list)))
     {
-	dir = FcConfigNormalizeFontDir (config, dir);
-	if (!dir)
-	    return FcFalse;
-
+	dir = FcConfigNormalizeFontDir (config, dir_orig);
+	
 	if (verbose)
 	{
-	    printf ("%s: \"%s\": ", program, dir);
+	    printf ("%s: \"%s\": ", program, dir ? dir : dir_orig);
 	    fflush (stdout);
 	}
+	
+	if (!dir)
+	{
+	    if (verbose)
+		printf ("skipping, no such directory\n");
+	    continue;
+	}
+	
+
 	set = FcFontSetCreate ();
 	if (!set)
 	{
-- 
Mike FABIAN   <mfabian@xxxxxxx>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux