diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-07-04 08:07:24 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-07-04 08:07:24 +0000 |
commit | 41404fb6c723ce4544de1b216df37c9da5119f59 (patch) | |
tree | 55b02b09c0fd3a45e3f213c0b48a5413ccf98d09 | |
parent | 715278d0631c1a165d2b9aae8e3650e1d7c2ad02 (diff) | |
download | zsh-41404fb6c723ce4544de1b216df37c9da5119f59.tar.gz zsh-41404fb6c723ce4544de1b216df37c9da5119f59.tar.xz zsh-41404fb6c723ce4544de1b216df37c9da5119f59.zip |
add some $(print...)s because of possible math-parse errors (12156)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Core/_expand | 6 | ||||
-rw-r--r-- | Completion/Core/_path_files | 5 |
3 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog index df8d147fc..41c782ce8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-07-04 Sven Wischnowsky <wischnow@zsh.org> + + * 12156: Completion/Core/_expand, Completion/Core/_path_files: add + some $(print...)s because of possible math-parse errors + 2000-07-03 Adam Spiers <adam@spiers.net> * 12152: Completion/User/_perl: tweak completion of Perl script diff --git a/Completion/Core/_expand b/Completion/Core/_expand index 5ac196428..4515a20a2 100644 --- a/Completion/Core/_expand +++ b/Completion/Core/_expand @@ -61,9 +61,9 @@ if [[ "$force" = *s* ]] || zstyle -T ":completion:${curcontext}:" substitute; then [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]] && eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \) - exp=( ${${(e)exp//\\[ + exp=( $(print -r ${${(e)exp//\\[ ]/ }//(#b)([ -])/\\$match[1]} ) 2>/dev/null +])/\\$match[1]}) ) 2>/dev/null else exp=( ${exp:s/\\\$/\$} ) fi @@ -95,7 +95,7 @@ subd=("$exp[@]") zstyle -s ":completion:${curcontext}:" keep-prefix tmp || tmp=changed if [[ "$word" = [\~\$]*/* && "$tmp" = (yes|true|on|1|changed) ]]; then - epre=( ${(e)~${word%%/*}} ) + epre=( $(print -r ${(e)~${word%%/*}}) ) 2>/dev/null if [[ -n "$epre" && $#epre -eq 1 ]]; then opre="${word%%/*}" pre="$epre[1]" diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 48e9dd299..d2de3f230 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -247,10 +247,9 @@ elif [[ "$pre" = *\$*/* && "$compstate[quote]" != \" ]]; then # after the first slash after the parameter expansion. # This fails for things like `f/$foo/b/<TAB>' where the first `f' is # meant as a partial path. - linepath="${(M)pre##*\$[^/]##/}" - realpath=${(e)~linepath} - [[ "$realpath" = "$linepath" ]] && return 1 + realpath=$(print -r ${(e)~linepath}) 2>/dev/null + [[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1 pre="${pre#${linepath}}" i="${#linepath//[^\\/]}" orig="${orig[1,(in:i:)/][1,-2]}" |