From 5def293ed66b04b5541d70bb899089af6241d44c Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 4 Jun 2015 11:58:34 +0900 Subject: [PATCH] Configuration file: ignore whitespace following the '=' sign --- config.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 28a3fa07..908650cd 100644 --- a/config.c +++ b/config.c @@ -335,7 +335,7 @@ parse_line(char *buff, char *name, char *value) int j = 0; /* - * first we find the name of the parameter + * Extract parameter name, if present */ for (; i < MAXLEN; ++i) { @@ -358,7 +358,20 @@ parse_line(char *buff, char *name, char *value) name[j] = '\0'; /* - * Now the value + * Ignore any whitespace following the '=' sign + */ + for (; i < MAXLEN; ++i) + { + if (buff[i+1] == ' ') + continue; + if (buff[i+1] == '\t') + continue; + + break; + } + + /* + * Extract parameter value */ j = 0; for (++i; i < MAXLEN; ++i)