diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-03-26 12:18:50 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-03-26 12:18:50 -0400 |
commit | 310bc847bca9e2457700598be99390867fd2a84e (patch) | |
tree | 7bb619ce83c0b397008605171fcaccb9ec9e6e01 /src | |
parent | 7e25b9c6e718437ed45aa2592598c63f0f87e70a (diff) | |
download | bfs-310bc847bca9e2457700598be99390867fd2a84e.tar.xz |
bfstd: Escape ASCII tildes
The POSIX spec [1] lists some characters that may need to be escaped.
Unfortunately, the document uses ˜ (U+02DC SMALL TILDE) instead of ~
(U+007E TILDE), and I copy-pasted from it.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02
Diffstat (limited to 'src')
-rw-r--r-- | src/bfstd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bfstd.c b/src/bfstd.c index 12af438..2499f00 100644 --- a/src/bfstd.c +++ b/src/bfstd.c @@ -908,7 +908,7 @@ static char *dollar_quote(char *dest, char *end, const char *str, size_t len, en /** How much of this string is safe as a bare word? */ static size_t bare_len(const char *str, size_t len) { // https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02 - size_t ret = strcspn(str, "|&;<>()$`\\\"' *?[#˜=%!{}"); + size_t ret = strcspn(str, "|&;<>()$`\\\"' *?[#~=%!{}"); return ret < len ? ret : len; } |