From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Eaton Date: Fri, 30 Jan 2004 00:14:51 +0000 Subject: udev patch for attributes with trailing spaces in the values Message-Id: <200401301014.51387.meaton@vasco.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_7HaGAms7qZ7QfSm" List-Id: To: linux-hotplug@vger.kernel.org --Boundary-00=_7HaGAms7qZ7QfSm Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline The following patch strips off spaces that are often contained at the end of SYSFS_ attributes. (ie lots of printers etc do this). I'm not sure if this should actually be added to udev but I would be curious to hear peoples thoughts as I find it extremly annoying and pointless to have to hexdump the sysfs values to check if there are trailing spaces to write the various rules. -- Mark Eaton Senior Software Engineer VASCO The Authentication Company +67 3511 5404 +67 (0) 403 384 886 meaton@vasco.com --Boundary-00=_7HaGAms7qZ7QfSm Content-Type: text/x-diff; charset="us-ascii"; name="spaces.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="spaces.patch" diff -Nru udev-015-orig/namedev.c udev-015/namedev.c --- udev-015-orig/namedev.c 2004-01-23 09:28:36.000000000 +1000 +++ udev-015/namedev.c 2004-01-30 08:59:10.000000000 +1000 @@ -427,7 +427,10 @@ label_found: c = tmpattr->value + strlen(tmpattr->value)-1; if (*c == '\n') - *c = 0x00; + *c-- = 0x00; + while (*c == ' ') + *c-- = 0x00; + dbg("compare attribute '%s' value '%s' with '%s'", pair->file, tmpattr->value, pair->value); if (strcmp_pattern(pair->value, tmpattr->value) != 0) --Boundary-00=_7HaGAms7qZ7QfSm-- ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ 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