xdg-open open_generic_xdg_x_scheme_handler has unquoted `[ -n $scheme ]` test
Submitted by Dominic Evans
Assigned to Portland Bugs
Link to original bug (#109437)
Description
xgd-open v1.1.3
A -n test doesn't work with unquoted arguments. The $scheme
must be double-quoted:
open_generic_xdg_x_scheme_handler()
{
scheme="echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'
"
if [ -n $scheme ]; then
filetype="x-scheme-handler/$scheme"
open_generic_xdg_mime "1" "
filetype"
fi
}
I'd suggest if [ -n "${scheme:-}" ]; then
Ref: https://github.com/koalaman/shellcheck/wiki/SC2070
Version: 1.1.0