From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Date: Wed, 17 Dec 2003 17:04:29 +0000 Subject: Re: [udev] don't rely on field order in namedev_parse Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi, On Tue, Dec 16, 2003 at 02:36:25AM +0100, Kay Sievers wrote: > 01-remove-field-ordering.diff > [...] > diff -Nru a/namedev_parse.c b/namedev_parse.c > --- a/namedev_parse.c Tue Dec 16 02:26:49 2003 > +++ b/namedev_parse.c Tue Dec 16 02:26:49 2003 > @@ -169,13 +156,8 @@ > if (temp = NULL) > goto exit; > lineno++; > - > dbg_parse("read '%s'", temp); > > - /* eat the whitespace at the beginning of the line */ > - while (isspace(*temp)) > - ++temp; > - > /* empty line? */ > if (*temp = 0x00) > continue; > @@ -184,199 +166,160 @@ > if (*temp = COMMENT_CHARACTER) > continue; > > + /* eat the whitespace */ > + while (isspace(*temp)) > + ++temp; > + > memset(&dev, 0x00, sizeof(struct config_device)); > This chunk broke parsing of blank lines and comments with blanks before '#'. Please revert it with the patch below. Roman. --- udev-009/namedev_parse.c~ 2003-12-16 05:26:49.000000000 +0300 +++ udev-009/namedev_parse.c 2003-12-17 20:00:21.000000000 +0300 @@ -158,6 +158,10 @@ lineno++; dbg_parse("read '%s'", temp); + /* eat the whitespace */ + while (isspace(*temp)) + ++temp; + /* empty line? */ if (*temp = 0x00) continue; @@ -166,10 +170,6 @@ if (*temp = COMMENT_CHARACTER) continue; - /* eat the whitespace */ - while (isspace(*temp)) - ++temp; - memset(&dev, 0x00, sizeof(struct config_device)); /* get the method */ ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel