All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marco d'Itri" <md@Linux.IT>
To: linux-hotplug@vger.kernel.org
Subject: Re: [ANNOUNCE] udev 021 release
Date: Wed, 03 Mar 2004 01:16:24 +0000	[thread overview]
Message-ID: <20040303011624.GA15729@wonderland.linux.it> (raw)
In-Reply-To: <20040303000957.GA11755@kroah.com>

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

On Mar 03, Greg KH <greg@kroah.com> wrote:

 >different distros were using.  If there's anything missing from udev, or
 >any patches that I've missed, please let me and the people at the
 >linux-hotplug-devel mailing list know about it.
What about the patches sent by multiple people to strip trailing blanks
from sysfs attributes? I still think it would be an useful feature.

I'm attaching a patch, untested.

-- 
ciao, |
Marco | [4868 caP3CkN9lIBa2]

[-- Attachment #2: strip_trailing_blanks --]
[-- Type: text/plain, Size: 910 bytes --]

diff -ruNp udev-019.orig/namedev.c udev-019/namedev.c
--- udev-019.orig/namedev.c	2004-02-28 17:46:22.000000000 +0100
+++ udev-019/namedev.c	2004-02-28 17:46:17.000000000 +0100
@@ -520,6 +520,17 @@ attr_found:
 	return tmpattr;
 }
 
+static void strip_trailing_blanks(char const *s)
+{
+	char *p;
+
+	for (p = s + strlen(s) - 1; p > s; p--) {
+		if (!isspace(*p))
+			break;
+		*p = '\0';
+	}
+}
+
 static int compare_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, struct sysfs_pair *pair)
 {
 	struct sysfs_attribute *tmpattr;
@@ -531,6 +542,8 @@ static int compare_sysfs_attribute(struc
 	if (tmpattr == NULL)
 		return -ENODEV;
 
+	strip_trailing_blanks(tmpattr->value);
+	strip_trailing_blanks(pair->value);
 	dbg("compare attribute '%s' value '%s' with '%s'",
 		  pair->file, tmpattr->value, pair->value);
 	if (strcmp_pattern(pair->value, tmpattr->value) != 0)

  parent reply	other threads:[~2004-03-03  1:16 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-03  0:09 [ANNOUNCE] udev 021 release Greg KH
2004-03-03  0:09 ` Greg KH
2004-03-03  0:25 ` Greg KH
2004-03-03  0:25   ` Greg KH
2004-03-03  1:16 ` Marco d'Itri [this message]
2004-03-03  3:09 ` Greg KH
2004-03-03  9:56 ` Michael Weiser
2004-03-03  9:56   ` Michael Weiser
2004-03-03 12:22   ` Ed Tomlinson
2004-03-03 12:22     ` Ed Tomlinson
2004-03-03 15:14     ` Greg KH
2004-03-03 15:14       ` Greg KH
2004-03-03 19:28       ` David Brownell
2004-03-03 19:28         ` David Brownell
2004-03-03 22:53       ` Michael Weiser
2004-03-03 22:53         ` Michael Weiser
2004-03-04  1:25         ` Greg KH
2004-03-04  1:25           ` Greg KH
2004-03-04  3:58           ` Bill Nottingham
2004-03-04  3:58             ` Bill Nottingham
2004-03-04 18:26             ` Greg KH
2004-03-04 18:26               ` Greg KH
2004-03-04 11:30           ` Romano Giannetti
2004-03-04  1:22       ` Marco d'Itri
2004-03-04  1:22         ` Marco d'Itri
2004-03-04  1:28         ` Greg KH
2004-03-04  1:28           ` Greg KH
2004-03-04  9:27           ` Michael Weiser
2004-03-04  9:27             ` Michael Weiser
2004-03-03 15:15   ` Greg KH
2004-03-03 15:15     ` Greg KH
2004-03-03 23:56     ` Michael Weiser
2004-03-03 23:56       ` Michael Weiser
2004-03-04  1:19       ` Greg KH
2004-03-04  1:19         ` Greg KH
2004-03-03 10:19 ` Marco d'Itri
2004-03-03 10:52 ` Alexander E. Patrakov
2004-03-03 11:02 ` Marco d'Itri
2004-03-03 15:49 ` Alexander E. Patrakov
2004-03-04  1:18 ` Marco d'Itri
2004-03-04  6:37 ` Dominik Kubla
2004-03-04 18:44   ` Greg KH
2004-03-04 18:44     ` Greg KH
2004-03-05  7:22     ` Dominik Kubla
2004-03-10 22:53       ` Greg KH
2004-03-10 22:53         ` Greg KH
2004-03-04 17:48 ` Martin Schlemmer
2004-03-04 18:46   ` Greg KH
2004-03-04 18:46     ` Greg KH
2004-03-04 18:56     ` Martin Schlemmer
2004-03-09 11:51 ` "Andrey Borzenkov" 
2004-03-10  2:34 ` Oliver Neukum
2004-03-10 12:29 ` "Andrey Borzenkov" 
2004-03-10 12:56 ` Prakash K. Cheemplavam
2004-03-10 12:56   ` Prakash K. Cheemplavam
2004-03-10 22:51   ` Greg KH
2004-03-10 22:51     ` Greg KH
2004-03-10 23:17     ` Prakash K. Cheemplavam
2004-03-10 23:17       ` Prakash K. Cheemplavam
2004-03-11  1:21       ` Greg KH
2004-03-11  1:21         ` Greg KH
2004-03-13  9:34         ` Prakash K. Cheemplavam
2004-03-13  9:34           ` Prakash K. Cheemplavam
2004-03-11  3:30 ` Oliver Neukum
2004-03-11  9:22 ` "Andrey Borzenkov" 
2004-03-12 23:39 ` Greg KH
     [not found] <1vshj-2ou-9@gated-at.bofh.it>
     [not found] ` <1vBuj-3YL-17@gated-at.bofh.it>
2004-03-03 13:51   ` Pascal Schmidt
     [not found] <20040303153403.21649.81059.Mailman@linux.us.dell.com>
     [not found] ` <4048D503.10808@mail.ru>
2004-03-09  8:19   ` Greg KH
2004-03-09  8:19     ` Greg KH
2004-03-09 10:16     ` rihad
2004-03-09 10:16       ` rihad
2004-03-09 13:43       ` Alex Goddard
2004-03-09 13:43         ` Alex Goddard
2004-03-10 22:52       ` Greg KH
2004-03-10 22:52         ` Greg KH
     [not found] <fa.dbn18ei.1k46o3i@ifi.uio.no>
     [not found] ` <fa.afjk56q.t0ulic@ifi.uio.no>
2004-03-10 13:02   ` walt
2004-03-10 13:02     ` walt
2004-03-10 21:01     ` Prakash K. Cheemplavam
2004-03-10 21:01       ` Prakash K. Cheemplavam
     [not found] <fa.fkf6pbs.vk4328@ifi.uio.no>
     [not found] ` <fa.aj3o3v7.pgqn9l@ifi.uio.no>
2004-03-10 23:01   ` walt
2004-03-11  0:11     ` Prakash K. Cheemplavam
2004-03-11  0:11       ` Prakash K. Cheemplavam

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=20040303011624.GA15729@wonderland.linux.it \
    --to=md@linux.it \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.