aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tool_parsecfg.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index 4d5145bcc..71be83d71 100644
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
@@ -188,6 +188,24 @@ int parseconfig(const char *filename,
while(*line && !ISSPACE(*line))
line++;
*line = '\0'; /* zero terminate */
+
+ /* to detect mistakes better, see if there's data following */
+ line++;
+ /* pass all spaces */
+ while(*line && ISSPACE(*line))
+ line++;
+
+ switch(*line) {
+ case '\0':
+ case '\r':
+ case '\n':
+ case '#': /* comment */
+ break;
+ default:
+ warnf(config, "%s:%d: warning: '%s' uses unquoted white space in the"
+ " line that may cause side-effects!\n",
+ filename, lineno, option);
+ }
}
if(param && !*param) {