summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2021-05-04 14:26:34 -0400
committerChet Ramey <chet.ramey@case.edu>2021-05-04 14:26:34 -0400
commit9ba3434aa5434e509300a3722b0479fd30480b44 (patch)
treeb413ff5459afc8dc0028f3a2fb934ac11c0d8c1b
parentcf3c762ecfff5b2f445647a0f1543693984a5540 (diff)
downloadreadline-9ba3434aa5434e509300a3722b0479fd30480b44.tar.gz
Readline-8.1 patch 1: fix version comparisons in startup files
-rw-r--r--bind.c15
-rw-r--r--patchlevel2
2 files changed, 9 insertions, 8 deletions
diff --git a/bind.c b/bind.c
index 87596dc..7610378 100644
--- 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. */
diff --git a/patchlevel b/patchlevel
index d8c9df7..fdf4740 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-0
+1