From 4180429d5d40908b443b03a35cbf0f41100c580f Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 16 Apr 2021 03:38:23 +0300 Subject: [PATCH] project--files-in-directory: Handle errors reported by 'find' * lisp/progmodes/project.el (project--files-in-directory): Handle errors reported by 'find' (bug#47799). --- lisp/progmodes/project.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fdca4462f55..1edbe069a4c 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -312,9 +312,15 @@ to find the list of ignores for each directory." (concat " -o " find-name-arg " ")) " " (shell-quote-argument ")")) - "")))) + ""))) + (output (with-output-to-string + (with-current-buffer standard-output + (let ((status + (process-file-shell-command command nil t))) + (unless (zerop status) + (error "File listing failed: %s" (buffer-string)))))))) (project--remote-file-names - (sort (split-string (shell-command-to-string command) "\0" t) + (sort (split-string output "\0" t) #'string<)))) (defun project--remote-file-names (local-files) -- 2.39.2