Blame SOURCES/fontconfig-no-dir-when-no-conf.patch

c5b8fc
From 3e5f70a16ac6d54f1e01c92ddaa5985deec1b7f9 Mon Sep 17 00:00:00 2001
c5b8fc
From: Akira TAGOH <akira@tagoh.org>
c5b8fc
Date: Mon, 2 Sep 2013 20:51:46 +0900
c5b8fc
Subject: [PATCH] Do not create a config dir for migration when no config files
c5b8fc
 nor dirs
c5b8fc
c5b8fc
---
c5b8fc
 src/fcxml.c | 15 ++++++++++-----
c5b8fc
 1 file changed, 10 insertions(+), 5 deletions(-)
c5b8fc
c5b8fc
diff --git a/src/fcxml.c b/src/fcxml.c
c5b8fc
index b464b4e..8ff10b6 100644
c5b8fc
--- a/src/fcxml.c
c5b8fc
+++ b/src/fcxml.c
c5b8fc
@@ -2233,11 +2233,6 @@ FcParseInclude (FcConfigParse *parse)
c5b8fc
 	    /* No config dir nor file on the XDG directory spec compliant place
c5b8fc
 	     * so need to guess what it is supposed to be.
c5b8fc
 	     */
c5b8fc
-	    FcChar8 *parent = FcStrDirname (s);
c5b8fc
-
c5b8fc
-	    if (!FcFileIsDir (parent))
c5b8fc
-		FcMakeDirectory (parent);
c5b8fc
-	    FcStrFree (parent);
c5b8fc
 	    if (FcStrStr (s, (const FcChar8 *)"conf.d") != NULL)
c5b8fc
 		goto userdir;
c5b8fc
 	    else
c5b8fc
@@ -2259,6 +2254,11 @@ FcParseInclude (FcConfigParse *parse)
c5b8fc
 	{
c5b8fc
 	    if (FcFileIsDir (filename))
c5b8fc
 	    {
c5b8fc
+		FcChar8 *parent = FcStrDirname (userdir);
c5b8fc
+
c5b8fc
+		if (!FcFileIsDir (parent))
c5b8fc
+		    FcMakeDirectory (parent);
c5b8fc
+		FcStrFree (parent);
c5b8fc
 		if (FcFileIsDir (userdir) ||
c5b8fc
 		    rename ((const char *)filename, (const char *)userdir) != 0 ||
c5b8fc
 		    symlink ((const char *)userdir, (const char *)filename) != 0)
c5b8fc
@@ -2272,6 +2272,11 @@ FcParseInclude (FcConfigParse *parse)
c5b8fc
 	    }
c5b8fc
 	    else
c5b8fc
 	    {
c5b8fc
+		FcChar8 *parent = FcStrDirname (userconf);
c5b8fc
+
c5b8fc
+		if (!FcFileIsDir (parent))
c5b8fc
+		    FcMakeDirectory (parent);
c5b8fc
+		FcStrFree (parent);
c5b8fc
 		if (FcFileIsFile (userconf) ||
c5b8fc
 		    rename ((const char *)filename, (const char *)userconf) != 0 ||
c5b8fc
 		    symlink ((const char *)userconf, (const char *)filename) != 0)
c5b8fc
-- 
c5b8fc
1.8.3.1
c5b8fc