From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Sat, 17 Apr 2004 01:33:07 +0000 Subject: Re: [PATCH] udevd test script Message-Id: <20040417013307.GD14096@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" List-Id: References: <20040415201141.GA11625@vrfy.org> In-Reply-To: <20040415201141.GA11625@vrfy.org> To: linux-hotplug@vger.kernel.org --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Apr 17, 2004 at 03:30:29AM +0200, Kay Sievers wrote: > On Sat, Apr 17, 2004 at 02:04:55AM +0200, Kay Sievers wrote: > > On Fri, Apr 16, 2004 at 04:04:42PM -0700, Greg KH wrote: > > > Oh, and if you run the latest udev_test.pl, we have a bunch more tests, > > > including a few that fail, if you were looking for something to do :) > > > > Will do it. We need to change apply_format(). I tries to expand the '%%' > > with the next iteration over the string and removes the '%'. > > The tests are all successful now. > If this patch breaks something else, we simply have too few tests :) Sorry, this silly keyboard layout with the 'y' next to the 'a' :) Here is the patch too. thanks, Kay --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="01-percent-escape.patch" ===== namedev.c 1.139 vs edited ===== --- 1.139/namedev.c Fri Apr 2 11:55:14 2004 +++ edited/namedev.c Sat Apr 17 03:23:25 2004 @@ -199,23 +199,21 @@ struct sysfs_attribute *tmpattr; pos = string; - while (1) { - pos = strchr(string, '%'); - if (pos != NULL) { - pos[0] = '\0'; - tail = pos+1; - len = get_format_len(&tail); - c = tail[0]; - strfieldcpy(temp, tail+1); - tail = temp; - } else { + pos = strchr(pos, '%'); + if (pos == NULL) break; - } - dbg("format=%c, string='%s', tail='%s'",c , string, tail); + pos[0] = '\0'; + tail = pos+1; + len = get_format_len(&tail); + c = tail[0]; + strfieldcpy(temp, tail+1); + tail = temp; + dbg("format=%c, string='%s', tail='%s'",c , string, tail); attr = get_format_attribute(&tail); + switch (c) { case 'b': if (strlen(udev->bus_id) == 0) @@ -286,6 +284,7 @@ break; case '%': strfieldcatmax(string, "%", maxsize); + pos++; break; default: dbg("unknown substitution type '%%%c'", c); --cNdxnHkX5QqsyA0e-- ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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