+2011-09-23 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Fix
+ nasty bug using wrong cached values.
+
2011-09-23 Alan Mackenzie <acm@muc.de>
* progmodes/cc-defs.el (c-version): Increase to 5.31.9.
"file-name-all-completions"
nil)))
(when cache-hit (list cache-hit))))
- (tramp-compat-number-sequence (length filename) 0 -1)))))
+ ;; We cannot use a length of 0, because file properties
+ ;; for "foo" and "foo/" are identical.
+ (tramp-compat-number-sequence (length filename) 1 -1)))))
;; Cache expired or no matching cache entry found so we need
;; to perform a remote operation.
(with-current-buffer (tramp-get-buffer v)
(goto-char (point-max))
- ;; Check result code, found in last line of output
+ ;; Check result code, found in last line of output.
(forward-line -1)
(if (looking-at "^fail$")
(progn
;; Grab error message from line before last line
- ;; (it was put there by `cd 2>&1')
+ ;; (it was put there by `cd 2>&1').
(forward-line -1)
(tramp-error
v 'file-error
(push (buffer-substring (point) (point-at-eol)) result)))
;; Because the remote op went through OK we know the
- ;; directory we `cd'-ed to exists
- (tramp-set-file-property
- v localname "file-exists-p" t)
+ ;; directory we `cd'-ed to exists.
+ (tramp-set-file-property v localname "file-exists-p" t)
;; Because the remote op went through OK we know every
;; file listed by `ls' exists.
v (concat localname entry) "file-exists-p" t))
result)
- ;; Store result in the cache
+ ;; Store result in the cache.
(tramp-set-file-property
v (concat localname filename)
- "file-name-all-completions"
- result))))))))
+ "file-name-all-completions" result))))))))
;; cp, mv and ln