commit 8136895671ed0afb9fc9f2228c53e22e74b578ec
parent f6040114919ba1a952994e58baf2ea65254ec101
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 15 Apr 2022 11:56:44 +0200
shlex: fix permissible characters
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/shlex/escape.ha b/shlex/escape.ha
@@ -14,15 +14,14 @@ fn is_safe(s: str) bool = {
break;
};
- if (!ascii::isprint(rn) || ascii::isspace(rn)) {
- return false;
- };
switch (rn) {
case '@', '%', '+', '=', ':', ',', '.', '/', '-' =>
- return false;
+ return true;
case =>
- yield;
+ if (!ascii::isalnum(rn) || ascii::isspace(rn)) {
+ return false;
+ };
};
};
return true;