changeset 18073:77cfc81a8ea5

pmccabe2html: fix gawk regex escaping * build-aux/pmccabe2html: Add one more backslash to properly escape the gsub replacement value. Fixes this error: gawk: ./build-aux/pmccabe2html:425: \ warning: escape sequence `\&' treated as plain `&'
author Assaf Gordon <assafgordon@gmail.com>
date Sat, 01 Aug 2015 23:30:07 -0600
parents 1a83dacc0869
children 5954852b97de
files ChangeLog build-aux/pmccabe2html
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-01  Assaf Gordon  <assafgordon@gmail.com>  (tiny change)
+
+	pmccabe2html: fix gawk regex escaping
+	* build-aux/pmccabe2html: Add one more backslash to properly
+	escape the gsub replacement value.  Fixes this error:
+	gawk: ./build-aux/pmccabe2html:425: \
+	warning: escape sequence `\&' treated as plain `&'
+
 2015-07-29  Paul Eggert  <eggert@cs.ucla.edu>
 
 	time_rz: port to pedantic memcpy
--- a/build-aux/pmccabe2html
+++ b/build-aux/pmccabe2html
@@ -422,9 +422,9 @@
 
             while ((getline codeline < (fname nfun "_fn.txt")) > 0)
             {
-                gsub(/&/, "\&amp;", codeline)	# Must come first.
-                gsub(/</, "\&lt;", codeline)
-                gsub(/>/, "\&gt;", codeline)
+                gsub(/&/, "\\&amp;", codeline)	# Must come first.
+                gsub(/</, "\\&lt;", codeline)
+                gsub(/>/, "\\&gt;", codeline)
 
                 print codeline
             }