fontconfig: Branch 'main' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 10 09:34:14 UTC 2025


 src/fcdir.c      |    7 ++++++-
 test/run-test.sh |   22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit 82ca32b33fbe1037f0827b0e8a1cabdf3e7d4fa6
Merge: 61d7990 8208897
Author: Akira TAGOH <akira at tagoh.org>
Date:   Tue Jun 10 09:34:11 2025 +0000

    Merge branch 'issues/469' into 'main'
    
    Allow dotfiles to scan for caching
    
    Closes #469
    
    See merge request fontconfig/fontconfig!424

commit 8208897ec75c704901baf2e5692c7cc0d2ac4cd0
Author: Akira TAGOH <akira at tagoh.org>
Date:   Tue Jun 10 16:50:36 2025 +0900

    Allow dotfiles to scan for caching
    
    Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/469
    
    Changelog: changed

diff --git a/src/fcdir.c b/src/fcdir.c
index 54be3b8..1387f6b 100644
--- a/src/fcdir.c
+++ b/src/fcdir.c
@@ -245,7 +245,12 @@ FcDirScanConfig (FcFontSet     *set,
 	goto bail1;
     }
     while ((e = readdir (d))) {
-	if (e->d_name[0] != '.' && strlen (e->d_name) < FC_MAX_FILE_LEN) {
+	/* Ignore . and .. */
+	if (e->d_name[0] == '.' &&
+	    (e->d_name[1] == 0 ||
+	     (e->d_name[1] == '.' && e->d_name[2] == 0)))
+	    continue;
+	if (strlen (e->d_name) < FC_MAX_FILE_LEN) {
 	    strcpy ((char *)base, (char *)e->d_name);
 	    if (!FcStrSetAdd (files, file_prefix)) {
 		ret = FcFalse;
diff --git a/test/run-test.sh b/test/run-test.sh
index ac6b57a..9b3c91c 100644
--- a/test/run-test.sh
+++ b/test/run-test.sh
@@ -170,6 +170,28 @@ fi
 $FCCACHE "$FONTDIR"/a
 check
 
+dotest "with a dotfile"
+prep
+FONT3=$(basename $FONT1)
+FONT4=$(basename $FONT2)
+cp "$FONT1" "$FONTDIR"/."$FONT3"
+cp "$FONT2" "$FONTDIR"/."$FONT4"
+if [ -n "${SOURCE_DATE_EPOCH:-}" ] && [ ${#SOURCE_DATE_EPOCH} -gt 0 ]; then
+    touch -m -t "$(fdate ${SOURCE_DATE_EPOCH})" "$FONTDIR"
+fi
+$FCCACHE "$FONTDIR"
+check
+
+dotest "with a dotdir"
+prep
+mkdir "$FONTDIR"/.a
+cp "$FONT1" "$FONT2" "$FONTDIR"/.a
+if [ -n "${SOURCE_DATE_EPOCH:-}" ] && [ ${#SOURCE_DATE_EPOCH} -gt 0 ]; then
+    touch -m -t "$(fdate ${SOURCE_DATE_EPOCH})" "$FONTDIR"
+fi
+$FCCACHE "$FONTDIR"
+check
+
 dotest "Complicated directory structure"
 prep
 mkdir "$FONTDIR"/a


More information about the Fontconfig mailing list