changeset 56742:19c16bca1b49

(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.
author David Kastrup <dak@gnu.org>
date Sat, 21 Aug 2004 21:50:06 +0000
parents 8a6197b06d44
children a95911085179
files lisp/ChangeLog lisp/net/ange-ftp.el
diffstat 2 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Aug 21 15:00:26 2004 +0000
+++ b/lisp/ChangeLog	Sat Aug 21 21:50:06 2004 +0000
@@ -1,3 +1,11 @@
+2004-08-21  David Kastrup  <dak@gnu.org>
+
+	* net/ange-ftp.el (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.
+
 2004-08-21  John Paul Wallington  <jpw@gnu.org>
 
 	* subr.el (process-kill-without-query): Made obsolete in
--- a/lisp/net/ange-ftp.el	Sat Aug 21 15:00:26 2004 +0000
+++ b/lisp/net/ange-ftp.el	Sat Aug 21 21:50:06 2004 +0000
@@ -1014,7 +1014,7 @@
 
 (defun ange-ftp-hash-entry-exists-p (key tbl)
   "Return whether there is an association for KEY in TABLE."
-  (not (eq (gethash key tbl 'unknown) 'unknown)))
+  (and tbl (not (eq (gethash key tbl 'unknown) 'unknown))))
 
 (defun ange-ftp-hash-table-keys (tbl)
   "Return a sorted list of all the active keys in TABLE, as strings."
@@ -2919,11 +2919,8 @@
 	       ;; error message.
 	       (gethash "." ent))
 	  ;; Child lookup failed, so try the parent.
-	  (let ((table (ange-ftp-get-files dir 'no-error)))
-	    ;; If the dir doesn't exist, don't use it as a hash table.
-	    (and table
-		 (ange-ftp-hash-entry-exists-p file
-					       table)))))))
+	  (ange-ftp-hash-entry-exists-p
+	   file (ange-ftp-get-files dir 'no-error))))))
 
 (defun ange-ftp-get-file-entry (name)
   "Given NAME, return the given file entry.
@@ -3374,11 +3371,11 @@
   (setq file (ange-ftp-expand-file-name file))
   (if (ange-ftp-ftp-name file)
       (condition-case nil
-	  (let ((file-ent
-		 (gethash
-		  (ange-ftp-get-file-part file)
-		  (ange-ftp-get-files (file-name-directory file)))))
-	    (and (stringp file-ent) file-ent))
+	  (let ((ent (ange-ftp-get-files (file-name-directory file))))
+	    (and ent
+		 (stringp (setq ent
+				(gethash (ange-ftp-get-file-part file) ent)))
+		 ent))
 	;; If we can't read the parent directory, just assume
 	;; this file is not a symlink.
 	;; This makes it possible to access a directory that