emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat cc0bc30e51: Fix format-prompt of an empty string


From: ELPA Syncer
Subject: [elpa] externals/compat cc0bc30e51: Fix format-prompt of an empty string as "default" argument
Date: Fri, 24 Jun 2022 04:57:24 -0400 (EDT)

branch: externals/compat
commit cc0bc30e513269a99cdde25aee01d77b8944c074
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Fix format-prompt of an empty string as "default" argument
---
 compat-28.el    | 2 +-
 compat-tests.el | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/compat-28.el b/compat-28.el
index 5a984ddce4..874e3e4780 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -732,7 +732,7 @@ is included in the return value."
      (apply #'format prompt format-args))
    (and default
         (or (not (stringp default))
-            (not (null default)))
+            (> (length default) 0))
         (format " (default %s)"
                 (if (consp default)
                     (car default)
diff --git a/compat-tests.el b/compat-tests.el
index 09a135fea4..2ec6ed9aaa 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1067,6 +1067,8 @@ being compared against."
 
 (compat-deftest format-prompt
   (ought "Prompt: " "Prompt" nil)
+  (ought "Prompt: " "Prompt" "")
+  (ought "Prompt (default  ): " "Prompt" " ")
   (ought "Prompt (default 3): " "Prompt" 3)
   (ought "Prompt (default abc): " "Prompt" "abc")
   (ought "Prompt (default abc def): " "Prompt" "abc def")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]