From: VOS Maintainer Date: Thu, 8 Mar 2012 13:52:41 +0000 (+0000) Subject: * Fixed use portable method for escaping symbol for gawk 3 and 4 X-Git-Tag: archive/raspbian/6.1.6+dfsg2-4+rpi1~1^2^2^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4fc95c1132e25d8dce5cadeda50a71fedf128af5;p=virtuoso-opensource.git * Fixed use portable method for escaping symbol for gawk 3 and 4 Gbp-Pq: Name portable-method-for-escaping-symbol-gawk.diff --- diff --git a/binsrc/cached_resources/res_to_c.awk b/binsrc/cached_resources/res_to_c.awk index 31b4c5c9..9de67890 100644 --- a/binsrc/cached_resources/res_to_c.awk +++ b/binsrc/cached_resources/res_to_c.awk @@ -30,13 +30,7 @@ BEGIN { } { fun = $0 - # was: gsub ( /\\/, "\\\\", fun) - q = "\\\\" - if (PROCINFO["version"] ~ /^4/) - gsub ( q, q q, fun) - else - gsub ( q, q, fun) - + gsub ( "\\\\", "&&", fun) gsub ( /"/, "\\\"", fun) gsub ( /\$/, "\\044", fun) gsub ( /.*/, "\"&\\n\",", fun) diff --git a/binsrc/hosting/perl/pl_to_c.awk b/binsrc/hosting/perl/pl_to_c.awk index 369610f7..7307d419 100644 --- a/binsrc/hosting/perl/pl_to_c.awk +++ b/binsrc/hosting/perl/pl_to_c.awk @@ -42,7 +42,7 @@ END { } x = $0 - gsub (/\\/, "\\\\", x) + gsub ( "\\\\", "&&", x) gsub (/\"/, "\\\"", x) print "\"" x "\\n\"" } diff --git a/binsrc/hosting/python/py_to_c.awk b/binsrc/hosting/python/py_to_c.awk index f7d6935f..8de18514 100644 --- a/binsrc/hosting/python/py_to_c.awk +++ b/binsrc/hosting/python/py_to_c.awk @@ -48,7 +48,7 @@ END { } x = $0 - gsub (/\\/, "\\\\", x) + gsub ( "\\\\", "&&", x) gsub (/\"/, "\\\"", x) print "\"" x "\\n\"" } diff --git a/binsrc/ws/wsrm/xsd2sql.awk b/binsrc/ws/wsrm/xsd2sql.awk index 074a30d7..27052075 100644 --- a/binsrc/ws/wsrm/xsd2sql.awk +++ b/binsrc/ws/wsrm/xsd2sql.awk @@ -54,7 +54,7 @@ BEGIN { print " ses := string_output ();" } str = $0 - gsub ( /\\/, "\\\\", str) + gsub ( "\\\\", "&&", str) gsub ( /'/, "\\'", str) # diff --git a/libsrc/Wi/sql_to_c.awk b/libsrc/Wi/sql_to_c.awk index d5247037..3a2b52e0 100644 --- a/libsrc/Wi/sql_to_c.awk +++ b/libsrc/Wi/sql_to_c.awk @@ -343,13 +343,7 @@ BEGIN { # does escape the symbols fun = $0 - q = "\\\\" - if (PROCINFO["version"] ~ /^4/) - gsub ( q, q q, fun) - else - gsub ( q, q, fun) - - #WAS: gsub ( /\\/, "\\\\", fun) + gsub ("\\\\", "&&", fun) # remove whitespace except when there is just a semicolon if ((in_xsl_mode == 0) && (in_xsd_mode == 0))