After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664740 - Key-value file parser, space after integer
Key-value file parser, space after integer
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gkeyfile
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-11-24 15:52 UTC by Trax Omar Givernaud
Modified: 2015-10-21 02:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
File with code to show problem (718 bytes, text/plain)
2011-11-24 15:52 UTC, Trax Omar Givernaud
  Details
Test that whitespace is allowed after numbers (1.25 KB, patch)
2015-10-20 03:11 UTC, Robert Ancell
accepted-commit_now Details | Review
Handle whitespace after boolean values. (2.29 KB, patch)
2015-10-20 03:11 UTC, Robert Ancell
accepted-commit_now Details | Review

Description Trax Omar Givernaud 2011-11-24 15:52:19 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
Comment 1 Matthias Clasen 2011-11-24 19:57:06 UTC
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.
Comment 2 Robert Ancell 2015-10-20 03:11:00 UTC
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.
Comment 3 Robert Ancell 2015-10-20 03:11:21 UTC
Created attachment 313717 [details] [review]
Handle whitespace after boolean values.
Comment 4 Colin Walters 2015-10-20 12:42:10 UTC
Review of attachment 313716 [details] [review]:

OK.
Comment 5 Colin Walters 2015-10-20 12:44:39 UTC
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?
Comment 6 Robert Ancell 2015-10-21 02:32:55 UTC
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.