about summary refs log tree commit diff
path: root/Completion/Base/Utility
diff options
context:
space:
mode:
authorFelix Rosencrantz <f_rosencrantz@users.sourceforge.net>2002-10-09 20:38:24 +0000
committerFelix Rosencrantz <f_rosencrantz@users.sourceforge.net>2002-10-09 20:38:24 +0000
commit114d799efd1463eb1d46c0ee33c5e45948fa9e7d (patch)
tree455193fc28eac7441b132fdf5136416f8e77dabf /Completion/Base/Utility
parentae8f4db3857a317a2cc2ff1c7533b7e911ec3221 (diff)
downloadzsh-114d799efd1463eb1d46c0ee33c5e45948fa9e7d.tar.gz
zsh-114d799efd1463eb1d46c0ee33c5e45948fa9e7d.tar.xz
zsh-114d799efd1463eb1d46c0ee33c5e45948fa9e7d.zip
Changes to _store_cache to allow cache names to contain slashes "/".
Diffstat (limited to 'Completion/Base/Utility')
-rw-r--r--Completion/Base/Utility/_store_cache19
1 files changed, 17 insertions, 2 deletions
diff --git a/Completion/Base/Utility/_store_cache b/Completion/Base/Utility/_store_cache
index 962c4f381..cb6e8d3b1 100644
--- a/Completion/Base/Utility/_store_cache
+++ b/Completion/Base/Utility/_store_cache
@@ -2,7 +2,7 @@
 #
 # Storage component of completions caching layer
 
-local _cache_ident
+local _cache_ident _cache_ident_dir
 _cache_ident="$1"
 
 if zstyle -t ":completion:${curcontext}:" use-cache; then
@@ -13,13 +13,28 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then
     if [[ -e "$_cache_dir" ]]; then
       _message "cache-dir style points to a non-directory\!"
     else
-      mkdir -p "$_cache_dir"
+      (zmodload zsh/files 2>/dev/null; mkdir -p "$_cache_dir" )
       if [[ ! -d "$_cache_dir" ]]; then
         _message "couldn't create cache-dir $_cache_dir"
         return 1
       fi
     fi
   fi
+  _cache_ident_dir="$_cache_dir/$_cache_ident"
+  _cache_ident_dir="$_cache_ident_dir:h"
+  
+  if [[ ! -d "$_cache_ident_dir" ]]; then
+    if [[ -e "$_cache_ident_dir" ]]; then
+      _message "cache ident dir points to a non-directory:$_cache_ident_dir"
+    else
+      (zmodload zsh/files 2>/dev/null; mkdir -p "$_cache_ident_dir")
+      if [[ ! -d "$_cache_ident_dir" ]]; then
+        _message "couldn't create cache-ident_dir $_cache_ident_dir"
+        return 1
+      fi
+    fi
+  fi
+  
 
   shift
   for var; do