Re: Config Parsing Error Reporting
Akira TAGOH <[email protected]> Sat, 6 Jul 2019 13:08:01 +0900
| Newsgroups | gmane.comp.fonts.fontconfig |
|---|---|
| Message-ID | <CACT-Cx3bKJnvO+UgQbUqQc5V_NUtqCXxFLx=5m5V4SZ6uG8tbQ@mail.gmail.com> |
--===============1032612846== Content-Type: multipart/alternative; boundary="00000000000053c4d2058cfb5cb6" --00000000000053c4d2058cfb5cb6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E5=B9=B47=E6=9C=886=E6=97=A5(=E5=9C=9F) 13:01 Lawrence D'Oliveiro <ldo= @geek-central.gen.nz>: > 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 =E2=80=9Ccomplain =3D FcFalse;=E2= =80=9D 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 =3D FcConfigParseAndLoadFromMemoryInternal (config, filename, > FcStrBufDoneStatic (&sbuf), complain, load); > - complain =3D FcFalse; /* no need to reclaim here */ > bail1: > FcStrBufDestroy (&sbuf); > bail0: > > causes the parse routine to return false on error, as expected. > > Any reason why that line is there? > _______________________________________________ > Fontconfig mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/fontconfig --00000000000053c4d2058cfb5cb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">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.=C2=A0</div><br><div class=3D"gma= il_quote"><div dir=3D"ltr" class=3D"gmail_attr">2019=E5=B9=B47=E6=9C=886=E6= =97=A5(=E5=9C=9F) 13:01 Lawrence D'Oliveiro <<a href=3D"mailto:ldo@g= eek-central.gen.nz">[email protected]</a>>:<br></div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;= padding-left:1ex">On Thu, 4 Jul 2019 19:04:25 +0900, Akira TAGOH wrote:<br> <br> > not returning FcFalse on fail is a bug.<br> <br> The problem seems to be caused by the =E2=80=9Ccomplain =3D FcFalse;=E2=80= =9D line in<br> the _FcConfigParse routine in fcxml.c. Removing it as follows:<br> <br> diff --git a/src/fcxml.c b/src/fcxml.c<br> index 2e5898e..4e7e76a 100644<br> --- a/src/fcxml.c<br> +++ b/src/fcxml.c<br> @@ -3604,7 +3604,6 @@ _FcConfigParse (FcConfig=C2=A0 *config,<br> =C2=A0 =C2=A0 =C2=A0close (fd);<br> <br> =C2=A0 =C2=A0 =C2=A0ret =3D FcConfigParseAndLoadFromMemoryInternal (config,= filename, FcStrBufDoneStatic (&sbuf), complain, load);<br> -=C2=A0 =C2=A0 complain =3D FcFalse; /* no need to reclaim here */<br> =C2=A0bail1:<br> =C2=A0 =C2=A0 =C2=A0FcStrBufDestroy (&sbuf);<br> =C2=A0bail0:<br> <br> causes the parse routine to return false on error, as expected.<br> <br> Any reason why that line is there?<br> _______________________________________________<br> Fontconfig mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank" rel= =3D"noreferrer">[email protected]</a><br> <a href=3D"https://lists.freedesktop.org/mailman/listinfo/fontconfig" rel= =3D"noreferrer noreferrer" target=3D"_blank">https://lists.freedesktop.org/= mailman/listinfo/fontconfig</a></blockquote></div> --00000000000053c4d2058cfb5cb6-- --===============1032612846== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KRm9udGNvbmZp ZyBtYWlsaW5nIGxpc3QKRm9udGNvbmZpZ0BsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9s aXN0cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9mb250Y29uZmln --===============1032612846==--