Trim trailing whitespace when loading config

This commit is contained in:
James Bunton 2016-09-24 11:21:38 +10:00 committed by Reginald Kennedy
parent ba474302eb
commit 94b5bca182

View file

@ -9573,6 +9573,11 @@ 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) {