[PATCH] scripts/kernel-doc: don't use uninitialized SRCTREE
authorRandy Dunlap <rdunlap@xenotime.net>
Thu, 7 Jul 2005 22:39:26 +0000 (15:39 -0700)
committerSam Ravnborg <sam@mars.(none)>
Wed, 13 Jul 2005 23:18:36 +0000 (23:18 +0000)
Current kernel-doc (perl) script generates this warning:
Use of uninitialized value in concatenation (.) or string at scripts/kernel-doc line 1668.

So explicitly check for SRCTREE in the ENV before using it,
and then if it is set, append a '/' to the end of it, otherwise
the SRCTREE + filename can (will) be missing the intermediate '/'.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/kernel-doc

index 0835dc2a8aa9f4070167faa2b27905c126049616..8aaf74e64183ff46972acb0ac1d312aed4c16bfb 100755 (executable)
@@ -1665,11 +1665,17 @@ sub xml_escape($) {
 }
 
 sub process_file($) {
-    my ($file) = "$ENV{'SRCTREE'}@_";
+    my $file;
     my $identifier;
     my $func;
     my $initial_section_counter = $section_counter;
 
+    if (defined($ENV{'SRCTREE'})) {
+       $file = "$ENV{'SRCTREE'}" . "/" . "@_";
+    }
+    else {
+       $file = "@_";
+    }
     if (defined($source_map{$file})) {
        $file = $source_map{$file};
     }