projects
/
mikachu
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
808bb02
)
Strip leading/trailing whitespace when parsing colors and other strings (bug #4937)
author
Dana Jansens
<danakj@orodu.net>
Fri, 14 Oct 2011 21:06:05 +0000
(17:06 -0400)
committer
Dana Jansens
<danakj@orodu.net>
Sun, 16 Oct 2011 22:51:51 +0000
(18:51 -0400)
obrender/theme.c
patch
|
blob
|
history
diff --git
a/obrender/theme.c
b/obrender/theme.c
index
7de9e19
..
b20182a
100644
(file)
--- a/
obrender/theme.c
+++ b/
obrender/theme.c
@@
-1797,6
+1797,7
@@
static gboolean read_string(XrmDatabase db, const gchar *rname, gchar **value)
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
+ g_strstrip(retvalue.addr);
*value = retvalue.addr;
ret = TRUE;
}
*value = retvalue.addr;
ret = TRUE;
}
@@
-1815,7
+1816,12
@@
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
- RrColor *c = RrColorParse(inst, retvalue.addr);
+ RrColor *c;
+
+ /* retvalue.addr is inside the xrdb database so we can't destroy it
+ but we can edit it in place, as g_strstrip does. */
+ g_strstrip(retvalue.addr);
+ c = RrColorParse(inst, retvalue.addr);
if (c != NULL) {
*value = c;
ret = TRUE;
if (c != NULL) {
*value = c;
ret = TRUE;