From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] Allow tab in rules
Date: Thu, 24 Feb 2005 10:13:59 +0000 [thread overview]
Message-ID: <421DA8E7.8020506@suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
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
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux AG S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: udev-allow-tab-in-rules.patch --]
[-- Type: text/x-patch, Size: 504 bytes --]
===== 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];
next reply other threads:[~2005-02-24 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-24 10:13 Hannes Reinecke [this message]
2005-02-25 13:31 ` [PATCH] Allow tab in rules Tobias Klauser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=421DA8E7.8020506@suse.de \
--to=hare@suse.de \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).