bug-bash
[Top][All Lists]
Advanced

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

Re: slash appended to tab so its two // at end


From: Grisha Levit
Subject: Re: slash appended to tab so its two // at end
Date: Wed, 19 Jul 2023 13:44:34 -0400

On Wed, Jul 19, 2023 at 12:57 PM Grisha Levit <grishalevit@gmail.com> wrote:
> Also I think this is not a bug -- readline is asked to append a slash
> to directory names and it does so.

It's easy enough to avoid printing the indicator slash if we just
printed a path already ending in a slash.  It's an improvement
cosmetically but I think correctness can be argued either way.

diff --git a/lib/readline/complete.c b/lib/readline/complete.c
index 4b3a4236..d0c6a8eb 100644
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
@@ -1059,6 +1059,10 @@ print_filename (char *to_print, char
*full_pathname, int prefix_bytes)
        }

       xfree (s);
+
+      if (extension_char == '/' && (s = strrchr (to_print, '/')) && s[1] == 0)
+        extension_char = 0;
+
       if (extension_char)
        {
          putc (extension_char, rl_outstream);



reply via email to

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