From 0fa7015cc8ae9774c1e449688e29dee0b6aee438 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Thu, 30 Sep 2004 16:05:47 +0000 Subject: * 20358: Completion/Unix/Command/_make: avoid potential gawk locale bug by not using awk. --- Completion/Unix/Command/_make | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Completion/Unix/Command/_make') 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+\/ || ' $file) ) else - tmp=( - $(awk '/^[a-zA-Z0-9][^\/\t=]+:([^=]|$)/ {print $1} - /^\.include */ || /^\.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 *(|".*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 -- cgit 1.4.1