Skip to content

Commit

Permalink
* Fixed use portable method for escaping symbol for gawk 3 and 4
Browse files Browse the repository at this point in the history
  • Loading branch information
VOS Maintainer committed Mar 8, 2012
1 parent b44bb09 commit b01c641
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
8 changes: 1 addition & 7 deletions binsrc/cached_resources/res_to_c.awk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion binsrc/hosting/perl/pl_to_c.awk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ END {
}

x = $0
gsub (/\\/, "\\\\", x)
gsub ( "\\\\", "&&", x)
gsub (/\"/, "\\\"", x)
print "\"" x "\\n\""
}
2 changes: 1 addition & 1 deletion binsrc/hosting/python/py_to_c.awk
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ END {
}

x = $0
gsub (/\\/, "\\\\", x)
gsub ( "\\\\", "&&", x)
gsub (/\"/, "\\\"", x)
print "\"" x "\\n\""
}
2 changes: 1 addition & 1 deletion binsrc/ws/wsrm/xsd2sql.awk
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ BEGIN {
print " ses := string_output ();"
}
str = $0
gsub ( /\\/, "\\\\", str)
gsub ( "\\\\", "&&", str)
gsub ( /'/, "\\'", str)

#
Expand Down
8 changes: 1 addition & 7 deletions libsrc/Wi/sql_to_c.awk
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b01c641

Please sign in to comment.