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 664830 - g_strescape doesn't natively handle \v (vertical tab)
g_strescape doesn't natively handle \v (vertical tab)
Status: VERIFIED INCOMPLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 664689
 
 
Reported: 2011-11-25 18:03 UTC by Travis Reitter
Modified: 2013-05-06 18:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix to handle '\v' by g_strescape() and g_strcompress() (3.60 KB, patch)
2011-12-20 09:21 UTC, Ravi Sankar Guntur
accepted-commit_now Details | Review
Fix to handle '\v' (vertical tab) by g_strescape() and g_strcompress(). (3.61 KB, patch)
2011-12-28 02:49 UTC, Matthias Clasen
committed Details | Review
Some minor updates of building.sgml (1.25 KB, patch)
2011-12-28 02:49 UTC, Matthias Clasen
committed Details | Review
Some minor updates of HACKING (1.65 KB, patch)
2011-12-28 02:49 UTC, Matthias Clasen
committed Details | Review

Description Travis Reitter 2011-11-25 18:03:03 UTC
The escape sequence '\v' is well-known for the vertical tab character (see isspace(3)), but g_strescape doesn't escape it specially as it does for \b, \t, \n, etc.
Comment 1 Matthias Clasen 2011-12-17 04:59:16 UTC
A patch for this would be welcome.
Comment 2 Ravi Sankar Guntur 2011-12-20 09:21:34 UTC
Created attachment 203936 [details] [review]
fix to handle '\v' by g_strescape() and g_strcompress()

Fix to handle '\v' by g_strescape() and g_strcompress().

Please review the patch.
Comment 3 Matthias Clasen 2011-12-22 00:59:14 UTC
Review of attachment 203936 [details] [review]:

Looks fine
Comment 4 Matthias Clasen 2011-12-28 02:49:23 UTC
The following fixes have been pushed:
8ca2647 Fix to handle '\v' (vertical tab) by g_strescape() and g_strcompress().
030bf82 Some minor updates of building.sgml
a3860d8 Some minor updates of HACKING
Comment 5 Matthias Clasen 2011-12-28 02:49:30 UTC
Created attachment 204274 [details] [review]
Fix to handle '\v' (vertical tab) by g_strescape() and g_strcompress().

fix enables g_strescape() and g_strcompress() to handle '\v' along with other
special characters - '\b', '\f', '\n', '\r', '\t', '\'.

https://bugzilla.gnome.org/show_bug.cgi?id=664830

Signed-off-by: Ravi Sankar Guntur <ravi.g@samsung.com>
Comment 6 Matthias Clasen 2011-12-28 02:49:34 UTC
Created attachment 204275 [details] [review]
Some minor updates of building.sgml
Comment 7 Matthias Clasen 2011-12-28 02:49:37 UTC
Created attachment 204276 [details] [review]
Some minor updates of HACKING
Comment 8 Tim Janik 2012-10-22 01:19:08 UTC
This patch breaks code that uses g_strescape() to serialize strings and GScanner to deserialize them, as the latter does not interpret "\v".

Note that even if GScanner is extended to cope, programs will still subtly run into issues if files are saved with a newer glib (using \v), and parsed with an older glib GScanner.
Comment 9 geert jordaens 2013-05-06 18:26:04 UTC
IMHO g_strescape()  could convert  "\v" to "\011" instead of "\\v" and not break g_strcompress() or GScanner.