changeset 42579:c914fba3811b

(ldap-search-internal): Skip error message from ldapsearch. Allow listing attribute names only. Do not open non-existent files.
author Pavel Janík <Pavel@Janik.cz>
date Sun, 06 Jan 2002 17:55:53 +0000
parents 281571076b02
children 70727fae4ed2
files lisp/net/ldap.el
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/ldap.el	Sun Jan 06 17:54:21 2002 +0000
+++ b/lisp/net/ldap.el	Sun Jan 06 17:55:53 2002 +0000
@@ -570,6 +570,9 @@
       (if (looking-at "usage")
 	  (error "Incorrect ldapsearch invocation")
 	(message "Parsing results... ")
+	;; Skip error message when retrieving attribute list
+	(if (looking-at "Size limit exceeded")
+	    (forward-line 1))
 	(while (progn
 		 (skip-chars-forward " \t\n")
 		 (not (eobp)))
@@ -580,13 +583,16 @@
 	  (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$")
 	    (setq name (match-string 1)
 		  value (match-string 3))
-	    (save-excursion
-	      (set-buffer bufval)
-	      (erase-buffer)
-	      (set-buffer-multibyte nil)
-	      (insert-file-contents-literally value)
-	      (delete-file value)
-	      (setq value (buffer-string)))
+	    ;; Do not try to open non-existent files
+	    (if (equal value "")
+		(setq value " ")
+	      (save-excursion
+		(set-buffer bufval)
+		(erase-buffer)
+		(set-buffer-multibyte nil)
+		(insert-file-contents-literally value)
+		(delete-file value)
+		(setq value (buffer-string))))
 	    (setq record (cons (list name value)
 			       record))
 	    (forward-line 1))