mirror of
https://github.com/notwa/rc
synced 2024-11-05 08:29:02 -08:00
simplify character whitelist using built-in shell expansions
This commit is contained in:
parent
7befe5065a
commit
cfd3c2b18b
1 changed files with 1 additions and 1 deletions
2
sh/oxo
2
sh/oxo
|
@ -65,7 +65,7 @@ oxo() { ### @-
|
|||
local g="$f"
|
||||
|
||||
# restrict the filepath to simple ascii characters that curl likes.
|
||||
if [ -n "$(printf '%s' "$f" | tr -d \''0-9A-Za-z !#$%&()*+,./;=@[]^_`{}~-')" ]; then
|
||||
if [ "$f" != "${f#*[! -~]}" ] || [ "$f" != "${f#*[\":<>?\\|]}" ]; then
|
||||
# copy the user's file to a temporary path and use that instead.
|
||||
g=/tmp/oxo
|
||||
#printf "$warn" "oxo: special characters found: $f" >&2
|
||||
|
|
Loading…
Reference in a new issue