This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: gen_keytables.pl: strip comments from C files
Author:  Sean Young <[email protected]>
Date:    Tue Jul 2 22:26:06 2019 +0100

Some keymaps contain mappings in comments which should have not been
included.

Cc: Bastien Nocera <[email protected]>
Signed-off-by: Sean Young <[email protected]>

 utils/keytable/gen_keytables.pl | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=3642805239f442df1df00b4a2486f7c914b56400
diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl
index 4124e3666337..8f3a87e65e73 100755
--- a/utils/keytable/gen_keytables.pl
+++ b/utils/keytable/gen_keytables.pl
@@ -82,7 +82,17 @@ sub parse_file($$)
 
        printf "processing file $filename\n" if ($debug);
        open IN, "<$filename" or die "couldn't find $filename";
-       while (<IN>) {
+       # read the entire file
+       my $file = do { local $/ = undef; <IN> };
+       close IN;
+
+       # remove comments
+       $file =~ s,/\*.*?\*/,,sg;
+       $file =~ s,//[^\n]*,,sg;
+
+       my @lines = split /\n/, $file;
+
+       foreach (@lines) {
                if (m/struct\s+rc_map_table\s+(\w[\w\d_]+)/) {
                        flush($filename, $legacy);
 
@@ -140,7 +150,6 @@ sub parse_file($$)
                        }
                }
        }
-       close IN;
 
        flush($filename, $legacy);
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to