From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Thu, 24 Feb 2005 10:13:59 +0000 Subject: [PATCH] Allow tab in rules Message-Id: <421DA8E7.8020506@suse.de> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------090006020307040003070801" List-Id: To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------090006020307040003070801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Hi all, namedev_parse is a bit overzealous when in comes to handling backspaces; it always eats up backspaces regardless of anything beyond that. This means it is impossible to enter '\t' in a rule. Quite a bit of fun when you're trying to write regexps. The attached patch fixes that, so now you should be able to use '\t' and '\\' within the rules file. Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de --------------090006020307040003070801 Content-Type: text/x-patch; name="udev-allow-tab-in-rules.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="udev-allow-tab-in-rules.patch" ===== namedev_parse.c 1.51 vs edited ===== --- 1.51/namedev_parse.c 2005-02-21 06:05:51 +01:00 +++ edited/namedev_parse.c 2005-02-24 11:11:45 +01:00 @@ -153,7 +153,11 @@ /* skip backslash and newline from multi line rules */ for (i = j = 0; i < count; i++) { - if (bufline[i] == '\\' || bufline[i] == '\n') + if ((bufline[i] == '\\') && + (bufline[i+1] != 't') && + (bufline[i+i] != '\\')) + continue; + if (bufline[i] == '\n') continue; line[j++] = bufline[i]; --------------090006020307040003070801-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&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