mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-28 16:09:51 +02:00
Bash-5.1 patch 7: fix version comparisons in readline startup files
This commit is contained in:
+8
-7
@@ -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. */
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
#define PATCHLEVEL 6
|
||||
#define PATCHLEVEL 7
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user