FcConfigParseAndLoadxxx Calls Do Not Return False On Config Errors
The documentation for FcConfigParseAndLoad
and FcConfigParseAndLoadFromMemory
says “Returns FcFalse if some error occurred while loading the file, either a parse error, semantic error or allocation failure. Otherwise returns FcTrue.”. However, these calls actually return true if errors are found in the config file. To make them work as documented, try the following patch.
diff --git a/src/fcxml.c b/src/fcxml.c
index 2e5898e..1591c5a 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -3620,7 +3620,7 @@ bail0:
FcConfigMessage (0, FcSevereError, "Cannot %s default config file", load ? "load" : "scan");
return FcFalse;
}
- return FcTrue;
+ return ret;
}