]> code.delx.au - spectrwm/blobdiff - spectrwm.c
Trim trailing whitespace when loading config
[spectrwm] / spectrwm.c
index 86fb7af2d4565fd2fd91b45513026b005d6696df..4cd953c5596725f377a3386ad9a3faec616cacc9 100644 (file)
@@ -9751,6 +9751,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) {