all repos — openbox @ fd9bb43059a4e106bfa07babb0eb2f93146e49b2

openbox fork - make it a bit more like ryudo

Strip leading/trailing whitespace when parsing colors and other strings (bug #4937)
Dana Jansens danakj@orodu.net
commit

fd9bb43059a4e106bfa07babb0eb2f93146e49b2

parent

808bb02af865950b0194cea56f6b2c2b5ccd7483

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M obrender/theme.cobrender/theme.c

@@ -1797,6 +1797,7 @@ XrmValue retvalue;

if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) && retvalue.addr != NULL) { + g_strstrip(retvalue.addr); *value = retvalue.addr; ret = TRUE; }

@@ -1815,7 +1816,12 @@ XrmValue retvalue;

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;