bug-readline
[Top][All Lists]
Advanced

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

Bug in $if version parsing


From: Tom Tromey
Subject: Bug in $if version parsing
Date: Mon, 18 Jan 2021 13:09:31 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

I change the GDB test suite to use this inputrc:

    $if version >= 8.0
    set enable-bracketed-paste off
    $endif

However, to my surprise, this did not work.  I believe this is a bug in
bind.c:parser_if.

This function computes 'op' as 'OP_GE' (ok so far), but then does:

        case OP_GE:
          _rl_parsing_conditionalized_out = rlversion >= versionarg;
          break;

This sets _rl_parsing_conditionalized_out to 1, but it should be 0.
I think all of these results should be inverted.  See the appended patch
for what I mean.

Tom

diff --git a/bind.c b/bind.c
index 87596dc..03aa03d 100644
--- a/bind.c
+++ b/bind.c
@@ -1312,6 +1312,7 @@ parser_if (char *args)
          _rl_parsing_conditionalized_out = rlversion <= versionarg;
          break;
        }
+      _rl_parsing_conditionalized_out = !_rl_parsing_conditionalized_out;
     }
   /* Check to see if the first word in ARGS is the same as the
      value stored in rl_readline_name. */



reply via email to

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