[libvirt] [PATCH v2 1/7] tools: vsh: Drop obsolete readline compatibility code

Andrea Bolognani posted 7 patches 6 years, 10 months ago
[libvirt] [PATCH v2 1/7] tools: vsh: Drop obsolete readline compatibility code
Posted by Andrea Bolognani 6 years, 10 months ago
This code is needed to use readline older than 4.1, but all
our target platforms ship with at least 6.0 these days so we
can safely get rid of it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 tools/vsh.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 65b96f87d5..f2486498c9 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2945,32 +2945,15 @@ vshReadlineInit(vshControl *ctl)
     /* Opaque data for autocomplete callbacks. */
     autoCompleteOpaque = ctl;
 
-    /* Allow conditional parsing of the ~/.inputrc file.
-     * Work around ancient readline 4.1 (hello Mac OS X),
-     * which declared it as 'char *' instead of 'const char *'.
-     */
-# if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION > 0x0402
     rl_readline_name = ctl->name;
-# else
-    rl_readline_name = (char *) ctl->name;
-# endif
 
     /* Tell the completer that we want a crack first. */
     rl_attempted_completion_function = vshReadlineCompletion;
 
-# if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION > 0x0402
     rl_basic_word_break_characters = break_characters;
-# else
-    rl_basic_word_break_characters = (char *) break_characters;
-# endif
 
-# if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION > 0x0402
     rl_completer_quote_characters = quote_characters;
     rl_char_is_quoted_p = vshReadlineCharIsQuoted;
-# else
-    rl_completer_quote_characters = (char *) quote_characters;
-    rl_char_is_quoted_p = (Function *) vshReadlineCharIsQuoted;
-# endif
 
     if (virAsprintf(&histsize_env, "%s_HISTSIZE", ctl->env_prefix) < 0)
         goto cleanup;
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/7] tools: vsh: Drop obsolete readline compatibility code
Posted by Daniel P. Berrangé 6 years, 10 months ago
On Tue, Apr 09, 2019 at 04:27:44PM +0200, Andrea Bolognani wrote:
> This code is needed to use readline older than 4.1, but all
> our target platforms ship with at least 6.0 these days so we
> can safely get rid of it.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  tools/vsh.c | 17 -----------------
>  1 file changed, 17 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list