# HG changeset patch
# User Pavel Janík <Pavel@Janik.cz>
# Date 1010339753 0
# Node ID c914fba3811b70f62488c17f25cd76d10cc544b6
# Parent  281571076b02ff6a3e3bcf30f1dbad8af8c7e66b
(ldap-search-internal): Skip error message from ldapsearch.  Allow listing
attribute names only.  Do not open non-existent files.

diff -r 281571076b02 -r c914fba3811b lisp/net/ldap.el
--- 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))