>From 15b9d238ddcca17004d9edce54b4b1fb80556764 Mon Sep 17 00:00:00 2001 From: Xi Lu Date: Thu, 5 Jan 2023 06:36:19 +0800 Subject: [PATCH] Fix split-string error if there is a space in the filename. * lisp/htmlfontify.el (hfy-list-files): Specify separator (\n\r). --- lisp/htmlfontify.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index c989a12d205..be020b6b1c5 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1826,8 +1826,9 @@ hfy-list-files ;;(message "hfy-list-files");;DBUG ;; FIXME: this changes the dir of the current buffer. Is that right?? (cd directory) - (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) - (split-string (shell-command-to-string hfy-find-cmd))) ) + (remove-if #'string-empty-p + (mapcar (lambda (F) (if (string-match "^./\\(.*\\)" F) (match-string 1 F) F)) + (split-string (shell-command-to-string hfy-find-cmd) "[\n\r]+")) )) ;; strip the filename off, return a directory name ;; not a particularly thorough implementation, but it will be -- 2.39.0