]> git.ipfire.org Git - thirdparty/readline.git/commitdiff
Readline-8.1 patch 1: fix version comparisons in startup files
authorChet Ramey <chet.ramey@case.edu>
Tue, 4 May 2021 18:26:34 +0000 (14:26 -0400)
committerChet Ramey <chet.ramey@case.edu>
Tue, 4 May 2021 18:26:34 +0000 (14:26 -0400)
bind.c
patchlevel

diff --git a/bind.c b/bind.c
index 87596dcec95ad161743c6adf84e25f15ba7401b3..76103786a66880aac0208fee8162802eaf536ec8 100644 (file)
--- a/bind.c
+++ b/bind.c
@@ -1234,7 +1234,7 @@ parser_if (char *args)
 #endif /* VI_MODE */
   else if (_rl_strnicmp (args, "version", 7) == 0)
     {
-      int rlversion, versionarg, op, previ, major, minor;
+      int rlversion, versionarg, op, previ, major, minor, opresult;
 
       _rl_parsing_conditionalized_out = 1;
       rlversion = RL_VERSION_MAJOR*10 + RL_VERSION_MINOR;
@@ -1294,24 +1294,25 @@ parser_if (char *args)
       switch (op)
        {
        case OP_EQ:
-         _rl_parsing_conditionalized_out = rlversion == versionarg;
+         opresult = rlversion == versionarg;
          break;
        case OP_NE:
-         _rl_parsing_conditionalized_out = rlversion != versionarg;
+         opresult = rlversion != versionarg;
          break;
        case OP_GT:
-         _rl_parsing_conditionalized_out = rlversion > versionarg;
+         opresult = rlversion > versionarg;
          break;
        case OP_GE:
-         _rl_parsing_conditionalized_out = rlversion >= versionarg;
+         opresult = rlversion >= versionarg;
          break;
        case OP_LT:
-         _rl_parsing_conditionalized_out = rlversion < versionarg;
+         opresult = rlversion < versionarg;
          break;
        case OP_LE:
-         _rl_parsing_conditionalized_out = rlversion <= versionarg;
+         opresult = rlversion <= versionarg;
          break;
        }
+      _rl_parsing_conditionalized_out = 1 - opresult;
     }
   /* Check to see if the first word in ARGS is the same as the
      value stored in rl_readline_name. */
index d8c9df7e6bb19b63a7c7f1c4f192a91529e40699..fdf474049fce8501d87e7b8fa7cf2b72cab0ad9b 100644 (file)
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-0
+1