Fri Sep 13 20:23:50 2019 UTC ()
pkgtools/libnbcompat: fix regular expression literals in AWK program

gawk: nbcompat.awk:5: warning:
regexp escape sequence `\#' is not a known regexp operator


(rillig)
diff -r1.2 -r1.3 pkgsrc/pkgtools/libnbcompat/files/nbcompat.awk

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/libnbcompat/files/nbcompat.awk (expand / switch to unified diff)

--- pkgsrc/pkgtools/libnbcompat/files/nbcompat.awk 2004/08/21 18:21:47 1.2
+++ pkgsrc/pkgtools/libnbcompat/files/nbcompat.awk 2019/09/13 20:23:50 1.3
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1BEGIN { process = 1 } 1BEGIN { process = 1 }
2 2
3/NBCOMPAT template section follows\./ { process = 0 } 3/NBCOMPAT template section follows\./ { process = 0 }
4 4
5/^\#[ ]*define[ ]+PACKAGE_.*/ { 5/^#[ ]*define[ ]+PACKAGE_.*/ {
6 if (process == 1) { 6 if (process == 1) {
7 print "/* " $0 " */"; 7 print "/* " $0 " */";
8 next; 8 next;
9 } 9 }
10} 10}
11 11
12/^\#[ ]*define[ ]+/ { 12/^#[ ]*define[ ]+/ {
13 if (process == 1) { 13 if (process == 1) {
14 guard = $0; 14 guard = $0;
15 sub("^#[ ]*define[ ]+", "", guard); 15 sub("^#[ ]*define[ ]+", "", guard);
16 sub("[ ]+.*", "", guard); 16 sub("[ ]+.*", "", guard);
17 print "#ifndef " guard; 17 print "#ifndef " guard;
18 print $0; 18 print $0;
19 print "#endif"; 19 print "#endif";
20 next; 20 next;
21 } 21 }
22} 22}
23 23
24{ print } 24{ print }