diff options
author | Akira TAGOH <akira@tagoh.org> | 2024-04-22 14:05:45 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2024-04-22 14:05:45 +0000 |
commit | 3b4641ae7a7bf961221cd7b55cc0e25d9d1a6365 (patch) | |
tree | 1a6d4b0c051ccbaa8fea14b19e6997442957048a | |
parent | 91145a1f5c49c8f57952626b007fa4e42de41a94 (diff) | |
parent | 42b12fc7c0855cddecdf6f4a0a26b897d53432a5 (diff) |
Merge branch 'list-cache-dirs-on-fail' into 'main'main
More information when no writable cache directories
Closes #413
See merge request fontconfig/fontconfig!323
-rw-r--r-- | src/fccache.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/fccache.c b/src/fccache.c index 54f76ac..e0dc4c9 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -1358,14 +1358,21 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config) unsigned int magic; int written; const FcChar8 *sysroot = FcConfigGetSysRoot (config); + FcStrSet *cpath; /* * Write it to the first directory in the list which is writable */ + cpath = FcStrSetCreateEx (FCSS_GROW_BY_64); + if (!cpath) + return FcFalse; list = FcStrListCreate (config->cacheDirs); if (!list) + { + FcStrSetDestroy (cpath); return FcFalse; + } while ((test_dir = FcStrListNext (list))) { if (d) @@ -1404,12 +1411,26 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config) FcDirCacheCreateTagFile (d); break; } + /* Record a path that was supposed to be a cache directory */ + FcStrSetAdd (cpath, d); } } if (!test_dir) - fprintf (stderr, "Fontconfig error: No writable cache directories\n"); + { + FcStrList *l; + FcChar8 *s; + + l = FcStrListCreate (cpath); + fprintf (stderr, "\nFontconfig error: No writable cache directories\n"); + while ((s = FcStrListNext (l))) + { + fprintf (stderr, "\t%s\n", s); + } + FcStrListDone (l); + } if (d) FcStrFree (d); + FcStrSetDestroy (cpath); FcStrListDone (list); if (!cache_dir) return FcFalse; |