scripts/namespace.pl: fix wrong source path
authorAmerigo Wang <amwang@redhat.com>
Wed, 27 Oct 2010 19:42:00 +0000 (12:42 -0700)
committerMichal Marek <mmarek@suse.cz>
Wed, 27 Oct 2010 22:07:45 +0000 (00:07 +0200)
File::Find will do chdir automatically, so we need to get the absolute
patch with $File::Find::dir.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Amerigo Wang <amwang@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/namespace.pl

index 361d0f7..fb4e245 100755 (executable)
@@ -167,11 +167,11 @@ sub do_nm
                printf STDERR "$fullname is not an object file\n";
                return;
        }
                printf STDERR "$fullname is not an object file\n";
                return;
        }
-       ($source = $fullname) =~ s/\.o$//;
-       if (-e "$objtree$source.c" || -e "$objtree$source.S") {
-               $source = "$objtree$source";
+       ($source = $basename) =~ s/\.o$//;
+       if (-e "$source.c" || -e "$source.S") {
+               $source = "$objtree$File::Find::dir/$source";
        } else {
        } else {
-               $source = "$srctree$source";
+               $source = "$srctree$File::Find::dir/$source";
        }
        if (! -e "$source.c" && ! -e "$source.S") {
                # No obvious source, exclude the object if it is conglomerate
        }
        if (! -e "$source.c" && ! -e "$source.S") {
                # No obvious source, exclude the object if it is conglomerate