diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-07-13 11:06:51 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-07-13 16:01:00 -0400 |
commit | 2cb1ae0b2ecc356706318948839cc80def53fb5e (patch) | |
tree | e07aa84b2866d75ba9465e6aa219c2292ada8aff /src | |
parent | 663a2b938707458de4e87be68cffb6a970e771c6 (diff) | |
download | bfs-2cb1ae0b2ecc356706318948839cc80def53fb5e.tar.xz |
bfstd: Escape '!' in wordesc()
Diffstat (limited to 'src')
-rw-r--r-- | src/bfstd.c | 4 |
1 files 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, "\""); |