diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_make | 15 |
2 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog index ed3a96071..f8a69b814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-30 Clint Adams <clint@zsh.org> + + * 20358: Completion/Unix/Command/_make: avoid potential gawk + locale bug by not using awk. + 2004-09-28 Clint Adams <clint@zsh.org> * 20414: Completion/Unix/Type/_diff_options: correct missing diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index 93dfcf866..5e5aaa5e9 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -1,6 +1,6 @@ #compdef make gmake pmake dmake -local prev="$words[CURRENT-1]" file expl tmp is_gnu cmdargs useperl +local prev="$words[CURRENT-1]" file expl tmp is_gnu useperl zstyle -t ":completion:${curcontext}:" use-perl && useperl=1 _pick_variant -r is_gnu gnu=GNU unix -v -f @@ -27,11 +27,10 @@ else if [[ $is_gnu = gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command; then if [[ -n $useperl ]]; then - cmdargs=(perl -ne '/^([a-zA-Z0-9][^\/\t=]+):([^=]|$)/ && print "$1\n"') + tmp=( $(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null | perl -ne '/^([a-zA-Z0-9][^\/\t=]+):([^=]|$)/ && print "$1\n"') ) else - cmdargs=(awk '/^[a-zA-Z0-9][^\/\t=]+:([^=]|$)/ {print $1}' FS=:) + tmp=(${${(M)${(f)"$(_call_program targets "$words[1]" -nsp --no-print-directory -f /tmp/rules .PHONY 2>/dev/null)"}:#[a-zA-Z0-9][^/\t=]##:([^=]*|(#e))}%:*}) fi - tmp=( $(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null | $cmdargs) ) elif [[ -n $useperl ]]; then tmp=( $(perl -ne '/^([a-zA-Z0-9][^\/\t=]+):([^=]|$)/ and print "$1\n"; @@ -42,11 +41,9 @@ if (/^\.include\s+\<bsd\.port\.(subdir\.|pre\.)?mk>/ || ' $file) ) else - tmp=( - $(awk '/^[a-zA-Z0-9][^\/\t=]+:([^=]|$)/ {print $1} - /^\.include *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ { - print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \ - FS=: $file) + tmp=( ${${(M)${(f)"$(<$file)"}:#[a-zA-Z0-9][^/\t=]##:([^=]*|(#e))}%:*} + $(grep -E '^\.include *(<bsd\.port\.(subdir\.|pre\.)?mk>|".*mk\/bsd\.pkg\.(subdir\.)?mk")' $file >/dev/null && + print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" ) ) fi _wanted targets expl 'make target' compadd -a tmp && return 0 |