Re: Config Parsing Error Reporting

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


FcConfigParseAndLoadFromMemoryInternal() is being shared by some functions and there are some duplicate messages in it. That flag is to avoid such thing though, it should be fixed by returning ret instead of FcTrue at the last line of that function. 

2019年7月6日(土) 13:01 Lawrence D'Oliveiro <ldo@xxxxxxxxxxxxxxxxxxx>:
On Thu, 4 Jul 2019 19:04:25 +0900, Akira TAGOH wrote:

> not returning FcFalse on fail is a bug.

The problem seems to be caused by the “complain = FcFalse;” line in
the _FcConfigParse routine in fcxml.c. Removing it as follows:

diff --git a/src/fcxml.c b/src/fcxml.c
index 2e5898e..4e7e76a 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -3604,7 +3604,6 @@ _FcConfigParse (FcConfig  *config,
     close (fd);

     ret = FcConfigParseAndLoadFromMemoryInternal (config, filename, FcStrBufDoneStatic (&sbuf), complain, load);
-    complain = FcFalse; /* no need to reclaim here */
     FcStrBufDestroy (&sbuf);

causes the parse routine to return false on error, as expected.

Any reason why that line is there?
Fontconfig mailing list
Fontconfig mailing list

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

  Powered by Linux