chiark / gitweb /
[PATCH] fix comment and whitespace handling in config files.
authorRoman.Kagan@itep.ru <Roman.Kagan@itep.ru>
Thu, 18 Dec 2003 02:24:05 +0000 (18:24 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:13:09 +0000 (21:13 -0700)
This chunk broke parsing of blank lines and comments with blanks before
'#'.  Please revert it with the patch below.

  Roman.

namedev_parse.c

index 9cd96a6..33e0c89 100644 (file)
@@ -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 */