From: Amerigo Wang Date: Wed, 27 Oct 2010 19:42:00 +0000 (-0700) Subject: scripts/namespace.pl: fix wrong source path X-Git-Tag: v2.6.37-rc1~50^2~12 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Flinux.git;a=commitdiff_plain;h=c25f415751c0c5507561d997fe5f7f05f4342912 scripts/namespace.pl: fix wrong source path File::Find will do chdir automatically, so we need to get the absolute patch with $File::Find::dir. Reported-by: Stephen Hemminger Signed-off-by: Amerigo Wang Cc: Michal Marek Signed-off-by: Andrew Morton Signed-off-by: Michal Marek --- diff --git a/scripts/namespace.pl b/scripts/namespace.pl index 361d0f71184b..fb4e24560736 100755 --- a/scripts/namespace.pl +++ b/scripts/namespace.pl @@ -167,11 +167,11 @@ sub do_nm 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 { - $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