aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Kastrup2004-08-21 21:50:06 +0000
committerDavid Kastrup2004-08-21 21:50:06 +0000
commit311f32fe0f3eed80d81cead7b935b8f32552df05 (patch)
treee575fb6883a74a9206bb0ff02bcf8247be0f98a1
parent3829aa6f66645cc3cc43658242f4a8c2427a3f07 (diff)
downloademacs-311f32fe0f3eed80d81cead7b935b8f32552df05.tar.gz
emacs-311f32fe0f3eed80d81cead7b935b8f32552df05.zip
(ange-ftp-hash-entry-exists-p)
(ange-ftp-file-entry-p, ange-ftp-file-symlink-p): Since the code has been converted to use hashtables, the relation `nil=none' is no longer valid, as `nil' is not a hashtable. This patch tries to reduce the number of resulting errors.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/net/ange-ftp.el19
2 files changed, 16 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5928601f7a3..73a098dd197 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12004-08-21 David Kastrup <dak@gnu.org>
2
3 * net/ange-ftp.el (ange-ftp-hash-entry-exists-p)
4 (ange-ftp-file-entry-p, ange-ftp-file-symlink-p): Since the code
5 has been converted to use hashtables, the relation `nil=none' is
6 no longer valid, as `nil' is not a hashtable. This patch tries to
7 reduce the number of resulting errors.
8
12004-08-21 John Paul Wallington <jpw@gnu.org> 92004-08-21 John Paul Wallington <jpw@gnu.org>
2 10
3 * subr.el (process-kill-without-query): Made obsolete in 11 * subr.el (process-kill-without-query): Made obsolete in
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 8e9d0bda5af..b9a7fc46148 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1014,7 +1014,7 @@ or nil meaning don't change it."
1014 1014
1015(defun ange-ftp-hash-entry-exists-p (key tbl) 1015(defun ange-ftp-hash-entry-exists-p (key tbl)
1016 "Return whether there is an association for KEY in TABLE." 1016 "Return whether there is an association for KEY in TABLE."
1017 (not (eq (gethash key tbl 'unknown) 'unknown))) 1017 (and tbl (not (eq (gethash key tbl 'unknown) 'unknown))))
1018 1018
1019(defun ange-ftp-hash-table-keys (tbl) 1019(defun ange-ftp-hash-table-keys (tbl)
1020 "Return a sorted list of all the active keys in TABLE, as strings." 1020 "Return a sorted list of all the active keys in TABLE, as strings."
@@ -2919,11 +2919,8 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained."
2919 ;; error message. 2919 ;; error message.
2920 (gethash "." ent)) 2920 (gethash "." ent))
2921 ;; Child lookup failed, so try the parent. 2921 ;; Child lookup failed, so try the parent.
2922 (let ((table (ange-ftp-get-files dir 'no-error))) 2922 (ange-ftp-hash-entry-exists-p
2923 ;; If the dir doesn't exist, don't use it as a hash table. 2923 file (ange-ftp-get-files dir 'no-error))))))
2924 (and table
2925 (ange-ftp-hash-entry-exists-p file
2926 table)))))))
2927 2924
2928(defun ange-ftp-get-file-entry (name) 2925(defun ange-ftp-get-file-entry (name)
2929 "Given NAME, return the given file entry. 2926 "Given NAME, return the given file entry.
@@ -3374,11 +3371,11 @@ system TYPE.")
3374 (setq file (ange-ftp-expand-file-name file)) 3371 (setq file (ange-ftp-expand-file-name file))
3375 (if (ange-ftp-ftp-name file) 3372 (if (ange-ftp-ftp-name file)
3376 (condition-case nil 3373 (condition-case nil
3377 (let ((file-ent 3374 (let ((ent (ange-ftp-get-files (file-name-directory file))))
3378 (gethash 3375 (and ent
3379 (ange-ftp-get-file-part file) 3376 (stringp (setq ent
3380 (ange-ftp-get-files (file-name-directory file))))) 3377 (gethash (ange-ftp-get-file-part file) ent)))
3381 (and (stringp file-ent) file-ent)) 3378 ent))
3382 ;; If we can't read the parent directory, just assume 3379 ;; If we can't read the parent directory, just assume
3383 ;; this file is not a symlink. 3380 ;; this file is not a symlink.
3384 ;; This makes it possible to access a directory that 3381 ;; This makes it possible to access a directory that