From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] fix NAME="foo-%c{N}" gets a truncated name
Date: Wed, 03 Mar 2004 23:46:33 +0000 [thread overview]
Message-ID: <20040303234633.GB14662@vrfy.org> (raw)
In-Reply-To: <20040303144334.A20521@beaverton.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 381 bytes --]
On Wed, Mar 03, 2004 at 02:43:34PM -0800, Patrick Mansfield wrote:
> Here is a fix and a new test for the problem Atul hit, where if we have a
> NAME based on a result of the form:
>
> NAME="foo-%c{7}"
>
> udev truncates the name. Without any prefix (the foo- in this example),
> the rule was working OK.
Here is a fix for the fix :)
Sorry, I broke it yesterday.
thanks,
Kay
[-- Attachment #2: 02-bugfix-c-char.patch --]
[-- Type: text/plain, Size: 966 bytes --]
===== namedev.c 1.122 vs edited =====
--- 1.122/namedev.c Wed Mar 3 06:00:21 2004
+++ edited/namedev.c Thu Mar 4 00:40:03 2004
@@ -214,6 +214,7 @@
struct sysfs_device *sysfs_device)
{
char temp[NAME_SIZE];
+ char temp2[NAME_SIZE];
char *tail;
char *pos;
char *attr;
@@ -277,6 +278,7 @@
i = atoi(attr);
if (i > 0) {
foreach_strpart(udev->program_result, " \n\r", spos, slen) {
+ strnfieldcpy(temp2, udev->program_result + spos, slen+1);
i--;
if (i == 0)
break;
@@ -285,8 +287,8 @@
dbg("requested part of result string not found");
break;
}
- strnfieldcat(string, udev->program_result + spos, slen+1);
- dbg("substitute part of result string '%s'", pos);
+ strnfieldcat(string, temp2, maxsize);
+ dbg("substitute part of result string '%s'", temp2);
} else {
strnfieldcat(string, udev->program_result, maxsize);
dbg("substitute result string '%s'", udev->program_result);
next prev parent reply other threads:[~2004-03-03 23:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-03 22:43 [PATCH] fix NAME="foo-%c{N}" gets a truncated name Patrick Mansfield
2004-03-03 22:58 ` Kay Sievers
2004-03-03 23:46 ` Kay Sievers [this message]
2004-03-03 23:57 ` Patrick Mansfield
2004-03-04 0:56 ` Greg KH
2004-03-04 0:56 ` Greg KH
2004-03-04 3:09 ` Kay Sievers
2004-03-04 18:57 ` Greg KH
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=20040303234633.GB14662@vrfy.org \
--to=kay.sievers@vrfy.org \
--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).