mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.6 series: fixed strange behaviour of scripts/modpost
Date: Tue, 2 Mar 2004 16:14:44 +0100	[thread overview]
Message-ID: <20040302151444.GA8217@zonque.dyndns.org> (raw)

Hi,

as I found out this morning, it's impossible to use the build-chain
tool modpost of the 2.6 kernel series from within a directory that
contains the character sequence '.o'. Weird things happen if you
try to do so.

With a directory structure like on my system here, building the
current DVB driver in '/home/daniel/cvs.linuxtv.org/dvb-kernel/build-2.6'
generates a file called '/home/daniel/cvs.linuxtv.mod.c' since modpost
cuts every filename string at the first occurence of '.o'.
Funny enough that obviously nobody ever renamed a kernel tree to
something like 'linux-2.6.2.orig' and tried to remake it afterwards ;)

Here's the patch that fixes it:

--- modpost.orig.c      2004-02-18 04:57:17.000000000 +0100
+++ modpost.c   2004-03-02 14:43:42.000000000 +0100
@@ -63,12 +63,12 @@
 new_module(char *modname)
 {
        struct module *mod;
-       char *p;
+       int len;
 
        /* strip trailing .o */
-       p = strstr(modname, ".o");
-       if (p)
-               *p = 0;
+       len = strlen (modname);
+       if (len > 2 && modname[len-2] == '.' && modname[len-1] == 'o')
+               modname[len-2] = 0;
 
        mod = NOFAIL(malloc(sizeof(*mod)));
        memset(mod, 0, sizeof(*mod));


Daniel

                 reply	other threads:[~2004-03-02 14:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040302151444.GA8217@zonque.dyndns.org \
    --to=daniel@zonque.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®