On Sun, Sep 10, 2023 at 08:58:39AM -0300, David Bremner wrote:
> David Bremner <da...@tethera.net> writes:
> > I usually like to start with a failing test, but it seems that may not
> > be possible here, since the actual failure only happens with specific
> > versions of glib.
> I guess the more interesting issue is making sure we propagate parsing
> errors from glib properly. Do you have an example of an init file syntax
> error that does consistently trigger a NULL return value (i.e. not bad
> escape, since that is apparently in flux).

Sure - put in some invalid UTF-8 (unlike invalid escape sequences
changing behavior over time, invalid UTF-8 has always been invalid in
g_key_file_get_string).  For example,

printf 'q3=from:\xff\n' >> .notmuch-config

into a config file that previously contains valid UTF-8 and ends in a
[query] block.

Even with glib2-2.76.1 installed, I'm back to the scenario where
'notmuch --config=.notmuch-config config list' outputs nothing with
exit status 0 (when it SHOULD have been reporting glib's error, "Key
file contains key ā€œ%sā€ with value ā€œ%sā€ which is not UTF-8").

Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org

notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org

Reply via email to