linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-media@vger.kernel.org
Subject: [PATCH 2/2] keytable: Remove comments before processing keymaps
Date: Mon,  1 Jul 2019 18:38:13 +0200	[thread overview]
Message-ID: <20190701163813.25032-2-hadess@hadess.net> (raw)
In-Reply-To: <20190701163813.25032-1-hadess@hadess.net>

Do our best to remove comments from each line we process from the keymap
sources, so as to avoid commented duplicates and false positives
sneaking in to the keymap definitions.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 utils/keytable/gen_keytables.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl
index 3dc74ba6..d73daf58 100755
--- a/utils/keytable/gen_keytables.pl
+++ b/utils/keytable/gen_keytables.pl
@@ -138,6 +138,9 @@ sub parse_file($$)
 		}
 
 		if ($read) {
+			# Remove comments
+			~ s#/\*.*?\*/##sg;
+			~ s#.*\*/##sg;
 			if (m/(0x[\dA-Fa-f]+)[\s\,]+(KEY|BTN)(\_[^\s\,\}]+)/) {
 				$out .= "$1 = \"$2$3\"\n";
 				next;
-- 
2.21.0


  reply	other threads:[~2019-07-01 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01 16:38 [PATCH 1/2] keytable: Add source information in generated keymaps Bastien Nocera
2019-07-01 16:38 ` Bastien Nocera [this message]
2019-07-02  9:08   ` [PATCH 2/2] keytable: Remove comments before processing keymaps Sean Young
2019-07-02  9:29     ` Bastien Nocera
2019-07-02  9:43     ` Bastien Nocera
2019-07-02 11:44       ` Sean Young
2019-07-02 13:20         ` Bastien Nocera
2019-07-03 15:33 ` [PATCH 1/2] keytable: Add source information in generated keymaps Sean Young
2019-07-04 13:22   ` Bastien Nocera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190701163813.25032-2-hadess@hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).