File: bash30-005.dpatch

package info (click to toggle)
bash3 3.0-12
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,736 kB
  • ctags: 34
  • sloc: sh: 3,053; makefile: 408
file content (82 lines) | stat: -rw-r--r-- 2,229 bytes parent folder | download
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
#! /bin/sh -e

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;;
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

# DP: upstream patch bash30-005

			     BASH PATCH REPORT
			     =================

Bash-Release: 3.0
Patch-ID: bash30-005

Bug-Reported-by: schwab@suse.de
Bug-Reference-ID: <20040801085535.E83D41DB3FFE9@sykes.suse.de>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00004.html

Bug-Description:

Moving upwards in the history (with previous-history) and back again
clobbers the last history line.

Patch:

*** ../bash-3.0/lib/readline/misc.c	Wed Jul  7 08:56:32 2004
--- lib/readline/misc.c	Sat Aug  7 22:38:53 2004
***************
*** 277,286 ****
        _rl_saved_line_for_history->data = (char *)rl_undo_list;
      }
-   else if (STREQ (rl_line_buffer, _rl_saved_line_for_history->line) == 0)
-     {
-       free (_rl_saved_line_for_history->line);
-       _rl_saved_line_for_history->line = savestring (rl_line_buffer);
-       _rl_saved_line_for_history->data = (char *)rl_undo_list;	/* XXX possible memleak */
-     }
  
    return 0;
--- 277,280 ----
*** ../bash-3.0/lib/readline/vi_mode.c	Tue Jul 13 14:08:27 2004
--- lib/readline/vi_mode.c	Tue Aug 17 00:12:09 2004
***************
*** 273,280 ****
--- 273,282 ----
      {
      case '?':
+       _rl_free_saved_history_line ();
        rl_noninc_forward_search (count, key);
        break;
  
      case '/':
+       _rl_free_saved_history_line ();
        rl_noninc_reverse_search (count, key);
        break;

*** ../bash-3.0/patchlevel.h	Wed Aug 22 08:05:39 2001
--- patchlevel.h	Thu Sep  2 15:04:32 2004
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 4
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 5
  
  #endif /* _PATCHLEVEL_H_ */