From f1fd8273b44fb232651e72ceb4af1da8492ea447 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 24 Feb 2003 11:33:04 +0000 Subject: 18230: Test for explicitly matched file in _path_files. --- Completion/Unix/Type/_path_files | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Completion') diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files index 45308bc93..b4d6e105e 100644 --- a/Completion/Unix/Type/_path_files +++ b/Completion/Unix/Type/_path_files @@ -324,8 +324,11 @@ for prepath in "$prepaths[@]"; do fi # Force auto-mounting. There might be a better way... + # Commented out in the hope that `pws non-canonical hack' + # down below does this for us. Can be uncommented if it + # doesn't. - : ${^tmp1}/${PREFIX}${SUFFIX}/.(/) + # : ${^tmp1}/${PREFIX}${SUFFIX}/.(/) # Get the matching files by globbing. @@ -343,6 +346,24 @@ for prepath in "$prepaths[@]"; do if [[ -n "$PREFIX$SUFFIX" ]]; then # See which of them match what's on the line. + # pws non-canonical hack which seems to work so far... + # if we didn't match by globbing, check that there is + # something to match by explicit name. This is for + # `clever' filing systems where names pop into existence + # when referenced. + if (( ! $#tmp1 )); then + for tmp3 in "$tmp2[@]"; do + if [[ -n $tmp3 && $tmp3 != */ ]]; then + tmp3+=/ + fi + if [[ -e "$tmp3${(Q)PREFIX}${(Q)SUFFIX}" ]] then + ## DEBUG + print "added $tmp3${(Q)PREFIX}${(Q)SUFFIX}" >&2 + tmp1+=("$tmp3${(Q)PREFIX}${(Q)SUFFIX}") + fi + done + fi + if (( ! $#tmp1 )); then tmp2=( ${^tmp2}/$PREFIX$SUFFIX ) elif [[ "$tmp1[1]" = */* ]]; then -- cgit 1.4.1