瀏覽代碼

[PATCH] scripts/kernel-doc: don't use uninitialized SRCTREE

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>
Randy Dunlap 20 年之前
父節點
當前提交
2283a117f6
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      scripts/kernel-doc

+ 7 - 1
scripts/kernel-doc

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