linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Eaton <meaton@vasco.com>
To: linux-hotplug@vger.kernel.org
Subject: udev patch for attributes with trailing spaces in the values
Date: Fri, 30 Jan 2004 00:14:51 +0000	[thread overview]
Message-ID: <200401301014.51387.meaton@vasco.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

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



[-- Attachment #2: spaces.patch --]
[-- Type: text/x-diff, Size: 503 bytes --]

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)

             reply	other threads:[~2004-01-30  0:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-30  0:14 Mark Eaton [this message]
2004-01-31  1:35 ` udev patch for attributes with trailing spaces in the values Kay Sievers
2004-02-17  1:25 ` Darren Salt

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=200401301014.51387.meaton@vasco.com \
    --to=meaton@vasco.com \
    --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).