summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-08-22 11:55:59 -0500
committerCase Duckworth2022-08-22 11:55:59 -0500
commit1af4c729ac6c12cc106c58a77f65bf639fefdd1b (patch)
tree9a73174d069c96d2ec76f45f6a3dc179ba88aa4e
parentMove ` escaping (diff)
downloadht-1af4c729ac6c12cc106c58a77f65bf639fefdd1b.tar.gz
ht-1af4c729ac6c12cc106c58a77f65bf639fefdd1b.zip
Escaping /should/ work now
-rwxr-xr-xht.awk3
1 files changed, 2 insertions, 1 deletions
diff --git a/ht.awk b/ht.awk index 8edd800..2d96620 100755 --- a/ht.awk +++ b/ht.awk
@@ -33,7 +33,6 @@ $0 ~ CONFIG["raw_delim"] {
33 33
34# Shell expansion escape hatch 34# Shell expansion escape hatch
35{ 35{
36 gsub(/\\/, "\\\\", $0)
37 gsub(/\$\$/, "$\a", $0) 36 gsub(/\$\$/, "$\a", $0)
38 gsub(/\$[^\a]/, "\\\\&", $0) 37 gsub(/\$[^\a]/, "\\\\&", $0)
39 gsub(/\$\a/, "$", $0) 38 gsub(/\$\a/, "$", $0)
@@ -137,6 +136,8 @@ $0 ~ ("^" COMMENT_DELIM) {
137 $0 = templ 136 $0 = templ
138 } 137 }
139 } 138 }
139 # Escape backslash and `
140 gsub(/\\/, "\\\\", $0)
140 gsub(/`/, "\\`", $0) 141 gsub(/`/, "\\`", $0)
141 # Push to buffer 142 # Push to buffer
142 bufpush($0, sep) 143 bufpush($0, sep)