From: Roman.Kagan@itep.ru Date: Thu, 18 Dec 2003 02:24:05 +0000 (-0800) Subject: [PATCH] fix comment and whitespace handling in config files. X-Git-Tag: 010~29 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=093bf8f4d2c44fb1f581dfec0330f3f86473496c [PATCH] fix comment and whitespace handling in config files. This chunk broke parsing of blank lines and comments with blanks before '#'. Please revert it with the patch below. Roman. --- diff --git a/namedev_parse.c b/namedev_parse.c index 9cd96a622..33e0c89e2 100644 --- a/namedev_parse.c +++ b/namedev_parse.c @@ -158,6 +158,10 @@ int namedev_init_rules(void) lineno++; dbg_parse("read '%s'", temp); + /* eat the whitespace */ + while (isspace(*temp)) + ++temp; + /* empty line? */ if (*temp == 0x00) continue; @@ -166,10 +170,6 @@ int namedev_init_rules(void) if (*temp == COMMENT_CHARACTER) continue; - /* eat the whitespace */ - while (isspace(*temp)) - ++temp; - memset(&dev, 0x00, sizeof(struct config_device)); /* get the method */