From: Sam Ravnborg <sam@ravnborg.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Daniel Mack <daniel@zonque.org>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.6.4-rc2: scripts/modpost.c
Date: Thu, 11 Mar 2004 06:53:10 +0100 [thread overview]
Message-ID: <20040311055310.GA2102@mars.ravnborg.org> (raw)
In-Reply-To: <1078965617.23891.103.camel@bach>
On Thu, Mar 11, 2004 at 11:40:18AM +1100, Rusty Russell wrote:
> On Thu, 2004-03-04 at 22:37, Daniel Mack wrote:
>
> > --- linux-2.6.4-rc2.orig/scripts/modpost.c 2004-03-04 11:40:21.000000000 +0100
> > +++ linux-2.6.4-rc2/scripts/modpost.c 2004-03-04 11:23:08.000000000 +0100
> > @@ -63,16 +63,16 @@
> > new_module(char *modname)
> > {
> > struct module *mod;
> > - char *p;
> > + int len;
> >
> > mod = NOFAIL(malloc(sizeof(*mod)));
> > memset(mod, 0, sizeof(*mod));
> > mod->name = NOFAIL(strdup(modname));
> >
> > /* strip trailing .o */
> > - p = strstr(mod->name, ".o");
> > - if (p)
> > - *p = 0;
> > + len = strlen(mod->name);
> > + if (len > 2 && mod->name[len-2] == '.' && mod->name[len-1] == 'o')
> > + mod->name[len-2] = 0;
> >
> > /* add to list */
> > mod->next = modules;
>
> Please use strrchr(mod->name, '.'). More readable, simpler, and ever
> arguably more correct.
OK.
I have some pending modpost changes (to fix MODULE_VERSION with O=),
so I will include the fix there.
Sam
next prev parent reply other threads:[~2004-03-11 5:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-04 11:37 [PATCH] 2.6.4-rc2: scripts/modpost.c Daniel Mack
2004-03-04 11:54 ` Andrew Morton
2004-03-04 13:01 ` Daniel Mack
2004-03-11 0:40 ` Rusty Russell
2004-03-11 5:53 ` Sam Ravnborg [this message]
[not found] <20040304172923.6045760e.rddunlap@osdl.org>
2004-03-05 5:24 ` Randy.Dunlap
2004-03-05 6:16 ` Tony Breeds
2004-03-05 12:36 ` Daniel Mack
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=20040311055310.GA2102@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=daniel@zonque.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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