bash-5.1-patch-7.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From b72f88db852104cf49cfb4762eda6e8f4fd20a70 Mon Sep 17 00:00:00 2001
  2. From: Chet Ramey <chet.ramey@case.edu>
  3. Date: Tue, 4 May 2021 14:31:05 -0400
  4. Subject: [PATCH] Bash-5.1 patch 7: fix version comparisons in readline startup
  5. files
  6. ---
  7. lib/readline/bind.c | 15 ++++++++-------
  8. patchlevel.h | 2 +-
  9. 2 files changed, 9 insertions(+), 8 deletions(-)
  10. diff --git a/lib/readline/bind.c b/lib/readline/bind.c
  11. index 87596dce..76103786 100644
  12. --- a/lib/readline/bind.c
  13. +++ b/lib/readline/bind.c
  14. @@ -1234,7 +1234,7 @@ parser_if (char *args)
  15. #endif /* VI_MODE */
  16. else if (_rl_strnicmp (args, "version", 7) == 0)
  17. {
  18. - int rlversion, versionarg, op, previ, major, minor;
  19. + int rlversion, versionarg, op, previ, major, minor, opresult;
  20. _rl_parsing_conditionalized_out = 1;
  21. rlversion = RL_VERSION_MAJOR*10 + RL_VERSION_MINOR;
  22. @@ -1294,24 +1294,25 @@ parser_if (char *args)
  23. switch (op)
  24. {
  25. case OP_EQ:
  26. - _rl_parsing_conditionalized_out = rlversion == versionarg;
  27. + opresult = rlversion == versionarg;
  28. break;
  29. case OP_NE:
  30. - _rl_parsing_conditionalized_out = rlversion != versionarg;
  31. + opresult = rlversion != versionarg;
  32. break;
  33. case OP_GT:
  34. - _rl_parsing_conditionalized_out = rlversion > versionarg;
  35. + opresult = rlversion > versionarg;
  36. break;
  37. case OP_GE:
  38. - _rl_parsing_conditionalized_out = rlversion >= versionarg;
  39. + opresult = rlversion >= versionarg;
  40. break;
  41. case OP_LT:
  42. - _rl_parsing_conditionalized_out = rlversion < versionarg;
  43. + opresult = rlversion < versionarg;
  44. break;
  45. case OP_LE:
  46. - _rl_parsing_conditionalized_out = rlversion <= versionarg;
  47. + opresult = rlversion <= versionarg;
  48. break;
  49. }
  50. + _rl_parsing_conditionalized_out = 1 - opresult;
  51. }
  52. /* Check to see if the first word in ARGS is the same as the
  53. value stored in rl_readline_name. */
  54. diff --git a/patchlevel.h b/patchlevel.h
  55. index 6257aeeb..c5ed66ab 100644
  56. --- a/patchlevel.h
  57. +++ b/patchlevel.h
  58. @@ -25,6 +25,6 @@
  59. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  60. looks for to find the patch level (for the sccs version string). */
  61. -#define PATCHLEVEL 6
  62. +#define PATCHLEVEL 7
  63. #endif /* _PATCHLEVEL_H_ */
  64. --
  65. 2.29.2