From: James Bunton Date: Sat, 24 Sep 2016 01:21:38 +0000 (+1000) Subject: Trim trailing whitespace when loading config X-Git-Url: https://code.delx.au/spectrwm/commitdiff_plain/08dcd447123e0781c032bce407291f8d3eef8d68 Trim trailing whitespace when loading config --- diff --git a/spectrwm.c b/spectrwm.c index 285bac9..ae753c8 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -9570,6 +9570,10 @@ conf_load(const char *filename, int keymapping) configopt[optidx].optname); continue; } + /* trim trailing spaces */ + ce = optval + strlen(optval) - 1; + while (ce > optval && isspace(*ce)) --ce; + *(ce + 1) = '\0'; /* call function to deal with it all */ if (configopt[optidx].func(optsub, optval, configopt[optidx].funcflags) != 0) {