]> code.delx.au - spectrwm/blobdiff - spectrwm.c
Trim trailing whitespace when loading config
[spectrwm] / spectrwm.c
index 285bac959e8cdee7b8b29241543dc0e0ab14d1dc..ae753c8762ca1c56e4c45d2a54031cd276804bc7 100644 (file)
@@ -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) {