about summary refs log tree commit diff
path: root/Completion/Core/_path_files
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r--Completion/Core/_path_files5
1 files changed, 2 insertions, 3 deletions
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]}"