diff options
-rw-r--r-- | acid.go | 2 | ||||
-rw-r--r-- | acid_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -102,7 +102,7 @@ var shellFuncs = ttemplate.FuncMap{ "quote": func(word string) string { // History expansion is annoying, don't let it cut us. if strings.IndexRune(word, '!') >= 0 { - return "'" + strings.ReplaceAll(word, "'", `'"'"'`) + "'" + return "'" + strings.ReplaceAll(word, "'", `'\''`) + "'" } const special = "$`\"\\" diff --git a/acid_test.go b/acid_test.go index f23d892..614fd0a 100644 --- a/acid_test.go +++ b/acid_test.go @@ -12,7 +12,7 @@ func TestTemplateQuote(t *testing.T) { for _, test := range []struct { input, output string }{ - {`!!`, `'!!'`}, + {`!!'!$`, `'!!'\''!$'`}, {``, `""`}, {`${var}`, `"\${var}"`}, {"`cat`", "\"\\`cat\\`\""}, |