guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] branch main updated: Fixed filename-completion-function


From: Daniel Llorens
Subject: [Guile-commits] branch main updated: Fixed filename-completion-function for readline completion
Date: Wed, 19 May 2021 09:50:59 -0400

This is an automated email from the git hooks/post-receive script.

lloda pushed a commit to branch main
in repository guile.

The following commit(s) were added to refs/heads/main by this push:
     new 02439a1  Fixed filename-completion-function for readline completion
02439a1 is described below

commit 02439a12406cbfb9214af2665dfd70986363eeb1
Author: Jakub Wojciech <jakub-w@riseup.net>
AuthorDate: Sun Dec 20 10:56:51 2020 +0100

    Fixed filename-completion-function for readline completion
    
    * guile-readline/readline.c (scm_filename_completion_function):
      A completion function should return #f when there's no more
      candidates.  Since the result of readline's
      rl_filename_completion_function was never checked it was impossible
      for it to work as intended and instead of #f it threw an error from
      trying to convert NULL to an scm string.
---
 guile-readline/readline.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index 5c4a326..7bb2394 100644
--- a/guile-readline/readline.c
+++ b/guile-readline/readline.c
@@ -386,8 +386,11 @@ SCM_DEFINE (scm_filename_completion_function, 
"filename-completion-function", 2,
 #else
   s = filename_completion_function (c_text, scm_is_true (continuep));
 #endif
-  ans = scm_take_locale_string (s);
   free (c_text);
+  if (!s) {
+    return SCM_BOOL_F;
+  }
+  ans = scm_take_locale_string (s);
   return ans;
 }
 #undef FUNC_NAME



reply via email to

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