+2006-02-06 Takashi Iwai <tiwai@suse.de>
+ reviewed by: plam
+ * fc-cache/fc-cache.c (scanDirs, main):
+
+ Don't loop infinitely on recursive symlinks.
+
2006-02-06 Takashi Iwai <tiwai@suse.de>
reviewed by: plam
* src/fccache.c (FcGlobalCacheLoad, FcGlobalCacheReadDir,
exit (1);
}
+static FcStrSet *processed_dirs;
+
static int
nsubdirs (FcStrSet *set)
{
continue;
}
+ if (FcStrSetMember (processed_dirs, dir))
+ {
+ if (verbose)
+ printf ("skipping, looped directory detected\n");
+ continue;
+ }
set = FcFontSetCreate ();
if (!set)
ret++;
continue;
}
+ FcStrSetAdd (processed_dirs, dir);
ret += scanDirs (sublist, config, program, force, verbose);
}
FcStrListDone (list);
}
else
list = FcConfigGetConfigDirs (config);
+
+ if ((processed_dirs = FcStrSetCreate()) == NULL) {
+ fprintf(stderr, "Cannot malloc\n");
+ return 1;
+ }
+
ret = scanDirs (list, config, argv[0], force, verbose);
+
+ FcStrSetDestroy (processed_dirs);
+
/*
* Now we need to sleep a second (or two, to be extra sure), to make
* sure that timestamps for changes after this run of fc-cache are later