summaryrefslogtreecommitdiffstats
path: root/source/a/bash/bash-5.1-patches/bash51-007
blob: ffd04fa4378d8f7499c208e125c0518fd1e0123c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
			     BASH PATCH REPORT
			     =================

Bash-Release:	5.1
Patch-ID:	bash51-007

Bug-Reported-by:	Tom Tromey <tom@tromey.com>
Bug-Reference-ID:	<875z3u9fd0.fsf@tromey.com>
Bug-Reference-URL:	https://lists.gnu.org/archive/html/bug-readline/2021-01/msg00009.html

Bug-Description:

The code to check readline versions in an inputrc file had the sense of the
comparisons reversed.

Patch (apply with `patch -p0'):

*** ../bash-5.1-patched/lib/readline/bind.c	2020-10-26 10:03:14.000000000 -0400
--- lib/readline/bind.c	2021-01-18 16:38:48.000000000 -0500
***************
*** 1235,1239 ****
    else if (_rl_strnicmp (args, "version", 7) == 0)
      {
!       int rlversion, versionarg, op, previ, major, minor;
  
        _rl_parsing_conditionalized_out = 1;
--- 1235,1239 ----
    else if (_rl_strnicmp (args, "version", 7) == 0)
      {
!       int rlversion, versionarg, op, previ, major, minor, opresult;
  
        _rl_parsing_conditionalized_out = 1;
***************
*** 1295,1316 ****
  	{
  	case OP_EQ:
! 	  _rl_parsing_conditionalized_out = rlversion == versionarg;
  	  break;
  	case OP_NE:
! 	  _rl_parsing_conditionalized_out = rlversion != versionarg;
  	  break;
  	case OP_GT:
! 	  _rl_parsing_conditionalized_out = rlversion > versionarg;
  	  break;
  	case OP_GE:
! 	  _rl_parsing_conditionalized_out = rlversion >= versionarg;
  	  break;
  	case OP_LT:
! 	  _rl_parsing_conditionalized_out = rlversion < versionarg;
  	  break;
  	case OP_LE:
! 	  _rl_parsing_conditionalized_out = rlversion <= versionarg;
  	  break;
  	}
      }
    /* Check to see if the first word in ARGS is the same as the
--- 1295,1317 ----
  	{
  	case OP_EQ:
!  	  opresult = rlversion == versionarg;
  	  break;
  	case OP_NE:
! 	  opresult = rlversion != versionarg;
  	  break;
  	case OP_GT:
! 	  opresult = rlversion > versionarg;
  	  break;
  	case OP_GE:
! 	  opresult = rlversion >= versionarg;
  	  break;
  	case OP_LT:
! 	  opresult = rlversion < versionarg;
  	  break;
  	case OP_LE:
! 	  opresult = rlversion <= versionarg;
  	  break;
  	}
+       _rl_parsing_conditionalized_out = 1 - opresult;
      }
    /* Check to see if the first word in ARGS is the same as the
*** ../bash-5.1/patchlevel.h	2020-06-22 14:51:03.000000000 -0400
--- patchlevel.h	2020-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 6
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 7
  
  #endif /* _PATCHLEVEL_H_ */