summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2010-07-26 23:49:19 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-07-26 23:56:00 +0200
commit5481991bc24e0408e9151f3f6746ef6316d69500 (patch)
tree5012ce23f1d5b0bd2ca78a83ca841af2d94adbf2 /scripts
parent3f4cfd6561b223d38b58eaab290c762954b5130c (diff)
downloadptxdist-5481991bc24e0408e9151f3f6746ef6316d69500.tar.gz
ptxdist-5481991bc24e0408e9151f3f6746ef6316d69500.tar.xz
[ptxd_make_import] cope with comments
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/lib/ptxd_make_import.awk12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/lib/ptxd_make_import.awk b/scripts/lib/ptxd_make_import.awk
index 8a457478d..a6a650dee 100755
--- a/scripts/lib/ptxd_make_import.awk
+++ b/scripts/lib/ptxd_make_import.awk
@@ -101,14 +101,14 @@ FNR == 1 {
# add prefix to symbols on line
#
function add_prefix(IN, in_match) {
-# depends on FOO && BAR
-# +----------------+ +--------+
-# | |
-# in_match[1] |
+# depends on FOO && BAR # comment
+# +----------------+ +--------+ +-------+
+# | | |
+# in_match[1] | in_match[7]
# |
# in_match[4]
- match(IN, /^([[:space:]]*(config|select|default|if|depends([[:space:]]+on)?)[[:space:]]+)((")?[^"]*(")?)$/, in_match);
+ match(IN, /^([[:space:]]*(config|select|default|if|depends([[:space:]]+on)?)[[:space:]]+)((")?[^"#]*(")?)(#.*)?/, in_match);
# don't convert things wrapped in ""
if (in_match[5] ~ /"/) {
@@ -116,7 +116,7 @@ function add_prefix(IN, in_match) {
}
# don't convert "N" symbols like in "default N"
- return in_match[1] gensub(/(!)?(N[A-Z0-9_]+|[A-MO-Z]+[A-Z0-9_]*)/, "\\1" prefix "\\2", "g", in_match[4]);
+ return in_match[1] gensub(/(!)?(N[A-Z0-9_]+|[A-MO-Z]+[A-Z0-9_]*)/, "\\1" prefix "\\2", "g", in_match[4]) in_match[7];
}