From 2cb1ae0b2ecc356706318948839cc80def53fb5e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 13 Jul 2023 11:06:51 -0400 Subject: bfstd: Escape '!' in wordesc() --- src/bfstd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bfstd.c b/src/bfstd.c index e5f9a31..e338831 100644 --- a/src/bfstd.c +++ b/src/bfstd.c @@ -633,11 +633,11 @@ char *wordesc(const char *str) { while (len > 0) { size_t plen = printable_len(str, len); - if (strcspn(str, "|&;<>()$`\\\"' *?[#˜=%") >= plen) { + if (strcspn(str, "|&;<>()$`\\\"' *?[#˜=%!") >= plen) { // Whole chunk is safe // https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02 cur = xstpencpy(cur, end, str, plen); - } else if (strcspn(str, "`$\\\"") >= plen) { + } else if (strcspn(str, "`$\\\"!") >= plen) { // Safe to double-quote the whole chunk // https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_03 cur = xstpecpy(cur, end, "\""); -- cgit v1.2.3