summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xv4l/scripts/make_kconfig.pl13
1 files changed, 9 insertions, 4 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl
index 57c663c00..8683ee4d8 100755
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -277,11 +277,13 @@ sub open_kconfig($$) {
my $in_help = 0;
my $default_seen = 0;
my $if;
+ my $line;
print "Opening $file\n" if $debug;
open $in, '<', $file or die "File not found: $file";
push @kconfigfiles, $file;
while (<$in>) {
+ $line = $_;
# In our Kconfig files, the first non-help line after the
# help text always has no indention. Technically, the
# help text is ended by just by the indention decreasing,
@@ -303,7 +305,7 @@ sub open_kconfig($$) {
print OUT "\tdefault n\n";
}
print OUT "\tdepends on VIDEO_KERNEL_VERSION\n";
- $_ = sprintf($disabled_msg, $minver{$key});
+ $line = sprintf($disabled_msg, $minver{$key});
}
next;
}
@@ -319,10 +321,13 @@ sub open_kconfig($$) {
}
next if (/^\s*#/ || /^\s*$/); # skip comments and blank lines
+ # Erase any comments on this line
+ s/(?<!\\)#(.*)$//;
+
if (m|^\s*source\s+"([^"]+)"\s*$| ||
m|^\s*source\s+(\S+)\s*$|) {
open_kconfig($dir, "$dir/$1");
- $_ = ''; # don't print the source line itself
+ $line = ''; # don't print the source line itself
next;
}
@@ -453,13 +458,13 @@ sub open_kconfig($$) {
if ($disabled) {
$default_seen = 1;
- $_ = "\tdefault n\n";
+ $line = "\tdefault n\n";
}
} else {
print "Skipping $file:$. $_" if $debug;
}
} continue {
- print OUT $_;
+ print OUT $line;
}
close $in;
}