[Fontconfig] 2.4 branch fc-cache

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

 



fc-cache isn't creating fonts.cache-2 files in directories w/ only
sub directories and no font files.

In src/fccache.c::FcDirCacheWrite() there is this:

    current_dir_block = FcDirCacheProduce (set, &metadata);

    if (!metadata.count)
    {
        unlink ((char *)cache_file);
        free (cache_file);
        return FcTrue;
    }

well before we get to:

    for (i = 0; i < dirs->size; i++)
        FcCacheWriteString (fd, (char *)dirs->strs[i]);
    FcCacheWriteString (fd, "");


The unlink() call should probably either be conditioned on
metadata.count NOR dirs->size or there should be a nested if
to write out a directories-only cache-2 file if there are no
font files in that dir, yes?

It does seem unlikely that readdir(2) followed by n stat(2) calls
is a win over a list of the sub dirs.

-JimC
-- 
James H. Cloos, Jr. <cloos@xxxxxxxxxxx>



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

  Powered by Linux