File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function __z -d "Jump to a recent directory."
1414 function __z_legacy_escape_regex
1515 # taken from escape_string_pcre2 in fish
1616 # used to provide compatibility with fish 2
17- for c in (string split ' ' $argv )
17+ for c in (string split -- ' ' $argv )
1818 if contains $c (string split ' ' ' .^$*+()?[{}\\ |-]' )
1919 printf \\
2020 end
@@ -123,15 +123,15 @@ function __z -d "Jump to a recent directory."
123123 for arg in $argv
124124 set -l escaped $arg
125125 if string escape --style =regex ' ' > /dev/null 2>&1 # use builtin escape if available
126- set escaped (string escape --style =regex $escaped )
126+ set escaped (string escape --style =regex -- $escaped )
127127 else
128128 set escaped (__z_legacy_escape_regex $escaped )
129129 end
130130 # Need to escape twice, see https://www.math.utah.edu/docs/info/gawk_5.html#SEC32
131- set escaped (string replace --all \\ \\\\ $escaped )
131+ set escaped (string replace --all -- \\ \\\\ $escaped )
132132 set qs $qs $escaped
133133 end
134- set -l q (string join ' .*' $qs )
134+ set -l q (string join -- ' .*' $qs )
135135
136136 if set -q _flag_list
137137 # Handle list separately as it can print common path information to stderr
You can’t perform that action at this time.
0 commit comments