From 937ae0cf55d31c332fba3d96061e2ac3653e5437 Mon Sep 17 00:00:00 2001 From: Filipp Gunbin Date: Thu, 20 Oct 2022 20:41:00 +0300 Subject: [PATCH] Fix ldapsearch output parsing in ldap-search-internal * lisp/net/ldap.el (ldap-search-internal): When parsing output, make sure that file:// matched before opening the file. (bug#58605) --- lisp/net/ldap.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 062ff05d69c..ccad8c4edb1 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -715,14 +715,14 @@ an alist of attribute/value pairs." (eq (string-match "/\\(.:.*\\)$" value) 0)) (setq value (match-string 1 value))) ;; Do not try to open non-existent files - (if (equal value "") - (setq value " ") - (with-current-buffer bufval + (if (match-string 3) + (with-current-buffer bufval (erase-buffer) (set-buffer-multibyte nil) (insert-file-contents-literally value) (delete-file value) - (setq value (buffer-string)))) + (setq value (buffer-string))) + (setq value " ")) (setq record (cons (list name value) record)) (forward-line 1)) -- 2.39.5