[Fontconfig] Re: patch to fix endless loop in fc-cache

Patrick Lam plam at MIT.EDU
Mon Feb 6 07:47:48 PST 2006


Mike FABIAN wrote:
> Mike FABIAN <mfabian at suse.de> さんは書きました:
> 
> 
>>by Takashi Iwai <tiwai at suse.de>.
>>
>>fc-cache did loop endless if a subdirectory was a symlink
>>pointing to a directory higher up, e.g.
>>ln -s /usr/share/fonts /usr/share/fonts/ttt
> 
> 
> In addition to that patch for "fc-cache.c", another, similar patch
> is also necessary for "fccache.c", otherwise applications using
> fontconfig will still loop.

The call to FcStrSetMember in FcCacheReadDirs is unneeded (here and
elsewhere), because FcStrSetAdd calls _FcStrSetAppend, which starts with:

    if (FcStrSetMember (set, s))
    {
        FcStrFree (s);
        return FcTrue;
    }

Also it would be good to avoid having this difficult-to-understand
global processed_dirs variable.  I'd much rather have it be passed to
FcCacheReadDirs.  Once I review Takashi's first patch (hopefully later
today) I'll commit a modified version of this patch.

pat


More information about the Fontconfig mailing list