GNOME Bugzilla – Bug 664740
Key-value file parser, space after integer
Last modified: 2015-10-21 02:33:16 UTC
Created attachment 202065 [details] File with code to show problem Spaces after integer values make g_key_file_get_integer returning 0 See file attachement for a concret test
A patch that fixes this will have to give the same kind of treatment to boolean and other numeric values. Strings cannot be treated the same way, though. There's also going to be complications with lists of values.
Created attachment 313716 [details] [review] Test that whitespace is allowed after numbers Test that whitespace is allowed after numbers - this was fixed in commit 7a45dde4fe64b4f6c6d3ebc54dfb54d106290e9d.
Created attachment 313717 [details] [review] Handle whitespace after boolean values.
Review of attachment 313716 [details] [review]: OK.
Review of attachment 313717 [details] [review]: Patch looks fine, but I really like to see at least a brief justification in a commit message. In this case, something like: See http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html#entries "Space before and after the equals sign should be ignored; the = sign is the actual delimiter." That is why we're fixing this, right?
Pushed with an updated commit message - thanks for the review! Note the fix is for trailing whitespace - leading whitespace is already correctly ignored as per the specification. Trailing whitespace doesn't seem to be mentioned but it is an easy mistake to make when manually editing keyfiles.