Re: Crash when non-existing directories are referenced in ~/.fonts.cache

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

 



Mike FABIAN wrote:
> The following code in FcConfigNormalizeFontDir ()
> 
>      /* Ok, we didn't find it in fontDirs; let's add subdirs.... */
>      for (n = 0; n < config->fontDirs->num; n++)
>  	FcConfigAddFontDirSubdirs (config, config->fontDirs->strs[n]);
> 
> adds the same subdirectories many times because 
> config->fontDirs->num is getting bigger during the for loop.
> 
> This causes many unnecessary opendir() and readdir() calls.
> 
> I think one should end the for loop when the initial value of
> config->fontDirs->num is reached. All values in the list after the
> initial value of num are newly added subdirectories, there is no
> reason to scan them for subdirectories again.

I've committed my version of this patch and a fix for fc-cache.

In my experience, fc-cache . and fc-cache with a trailing slash work
correctly now.  Let me know if there are any remaining issues.  I'll
also try to test it more myself.

pat
_______________________________________________
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