Patched download handler za-patch-dl-handler to avoid problems when the user provide a string in the ICE option dl containing new lines \n. Now new lines and leading /trailing spaces are correctly removed. (#17)
Some checks failed
Lint / commit (push) Failing after 0s
Lint / lint (push) Failing after 0s

This commit is contained in:
Andrea Alberti 2025-02-15 16:31:38 +01:00 committed by GitHub
parent 71218022d9
commit ddb174be3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,8 @@ fi
if [[ -n ${ICE[dl]} && ${ICE[dl]} != ink=[-/[:alnum:]]* ]]; then
local -a dls srcdst
dls=( "${(s.;.)ICE[dl]}" )
dls=( "${(s.;.)ICE[dl]}" ) # Strip leading and trailing spaces, but not new lines
dls=( "${dls[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" ) # Strip leading and trailing spaces inlcuding new lines; empty strings are removed
local dl hd tl
for dl ( $dls ); do
@ -92,8 +93,8 @@ fi
if [[ -n "${ICE[patch]}" ]]; then
local -a patches
patches=( "${(s.;.)ICE[patch]}" )
patches=( "${patches[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
patches=( "${(s.;.)ICE[patch]}" ) # Strip leading and trailing spaces, but not new lines
patches=( "${patches[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" ) # Strip leading and trailing spaces inlcuding new lines; empty strings are removed
local pch
for pch ( $patches ) {