~ubuntu-branches/ubuntu/lucid/bash/lucid

« back to all changes in this revision

Viewing changes to debian/patches/bash32-044.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-08-24 12:06:59 UTC
  • mfrom: (1.3.2 upstream) (2.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090824120659-gmp1uuy2w9k2st53
Tags: 4.0-4ubuntu1
* Merge with Debian; remaining changes:
  - Build from the upstream sources, build the documentation in info format.
  - /etc/skel/.bashrc: eval lesspipe.
* Changes to the skeleton .bashrc:
  - Source .bash_aliases after defining aliases. LP: #400686.
  - Enable color support for grep. LP: #386502.
* The bash docs now  describe uname -s not having any effect on many
  systems. LP: #378595.
* Don't ship an info dir file. LP: #358932.
* Fix some lintian warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
2
 
 
3
 
if [ $# -eq 3 -a "$2" = '-d' ]; then
4
 
    pdir="-d $3"
5
 
elif [ $# -ne 1 ]; then
6
 
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7
 
    exit 1
8
 
fi
9
 
case "$1" in
10
 
    -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;;
11
 
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
12
 
    *)
13
 
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14
 
        exit 1
15
 
esac
16
 
exit 0
17
 
 
18
 
# DP: bash-3.2 upstream patch bash32-044
19
 
 
20
 
                             BASH PATCH REPORT
21
 
                             =================
22
 
 
23
 
Bash-Release: 3.2
24
 
Patch-ID: bash32-044
25
 
 
26
 
Bug-Reported-by:        slinkp <stuff@slinkp.com>
27
 
Bug-Reference-ID:       <da52a26a-9f38-4861-a918-14d3482b539d@c65g2000hsa.googlegroups.com>
28
 
Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2008-05/msg00085.html
29
 
 
30
 
Bug-Description:
31
 
 
32
 
The presence of invisible characters in a prompt longer than the screenwidth
33
 
with invisible characters on the first and last prompt lines caused readline
34
 
to place the cursor in the wrong physical location.
35
 
 
36
 
Patch:
37
 
 
38
 
*** ../bash-3.2-patched/lib/readline/display.c  2007-12-14 21:12:40.000000000 -0500
39
 
--- lib/readline/display.c      2008-10-23 09:39:46.000000000 -0400
40
 
***************
41
 
*** 911,914 ****
42
 
--- 944,951 ----
43
 
             OFFSET (which has already been calculated above).  */
44
 
  
45
 
+ #define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
46
 
+ #define WRAP_OFFSET(line, offset)  ((line == 0) \
47
 
+                                       ? (offset ? INVIS_FIRST() : 0) \
48
 
+                                       : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
49
 
  #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
50
 
  #define VIS_LLEN(l)   ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
51
 
***************
52
 
*** 945,949 ****
53
 
                  _rl_last_c_pos > wrap_offset &&
54
 
                  o_cpos < prompt_last_invisible)
55
 
!               _rl_last_c_pos -= wrap_offset;
56
 
                  
57
 
              /* If this is the line with the prompt, we might need to
58
 
--- 982,992 ----
59
 
                  _rl_last_c_pos > wrap_offset &&
60
 
                  o_cpos < prompt_last_invisible)
61
 
!               _rl_last_c_pos -= prompt_invis_chars_first_line;        /* XXX - was wrap_offset */
62
 
!             else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth &&
63
 
!                       (MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
64
 
!                       cpos_adjusted == 0 &&
65
 
!                       _rl_last_c_pos != o_cpos &&
66
 
!                       _rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line))
67
 
!               _rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
68
 
                  
69
 
              /* If this is the line with the prompt, we might need to
70
 
***************
71
 
*** 1205,1209 ****
72
 
  {
73
 
    register char *ofd, *ols, *oe, *nfd, *nls, *ne;
74
 
!   int temp, lendiff, wsatend, od, nd, o_cpos;
75
 
    int current_invis_chars;
76
 
    int col_lendiff, col_temp;
77
 
--- 1264,1268 ----
78
 
  {
79
 
    register char *ofd, *ols, *oe, *nfd, *nls, *ne;
80
 
!   int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
81
 
    int current_invis_chars;
82
 
    int col_lendiff, col_temp;
83
 
***************
84
 
*** 1221,1225 ****
85
 
      temp = _rl_last_c_pos;
86
 
    else
87
 
!     temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
88
 
    if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
89
 
        && _rl_last_v_pos == current_line - 1)
90
 
--- 1280,1284 ----
91
 
      temp = _rl_last_c_pos;
92
 
    else
93
 
!     temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset);
94
 
    if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
95
 
        && _rl_last_v_pos == current_line - 1)
96
 
***************
97
 
*** 1587,1599 ****
98
 
            {
99
 
              _rl_output_some_chars (nfd + lendiff, temp - lendiff);
100
 
- #if 1
101
 
             /* XXX -- this bears closer inspection.  Fixes a redisplay bug
102
 
                reported against bash-3.0-alpha by Andreas Schwab involving
103
 
                multibyte characters and prompt strings with invisible
104
 
                characters, but was previously disabled. */
105
 
!             _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
106
 
! #else
107
 
!             _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
108
 
! #endif
109
 
            }
110
 
        }
111
 
--- 1648,1660 ----
112
 
            {
113
 
              _rl_output_some_chars (nfd + lendiff, temp - lendiff);
114
 
             /* XXX -- this bears closer inspection.  Fixes a redisplay bug
115
 
                reported against bash-3.0-alpha by Andreas Schwab involving
116
 
                multibyte characters and prompt strings with invisible
117
 
                characters, but was previously disabled. */
118
 
!             if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
119
 
!               twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
120
 
!             else
121
 
!               twidth = temp - lendiff;
122
 
!             _rl_last_c_pos += twidth;
123
 
            }
124
 
        }
125
 
***************
126
 
*** 1789,1793 ****
127
 
    int cpos, dpos;             /* current and desired cursor positions */
128
 
  
129
 
!   woff = W_OFFSET (_rl_last_v_pos, wrap_offset);
130
 
    cpos = _rl_last_c_pos;
131
 
  #if defined (HANDLE_MULTIBYTE)
132
 
--- 1850,1854 ----
133
 
    int cpos, dpos;             /* current and desired cursor positions */
134
 
  
135
 
!   woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
136
 
    cpos = _rl_last_c_pos;
137
 
  #if defined (HANDLE_MULTIBYTE)
138
 
***************
139
 
*** 1803,1807 ****
140
 
         prompt string, since they're both buffer indices and DPOS is a
141
 
         desired display position. */
142
 
!       if (new > prompt_last_invisible)                /* XXX - don't use woff here */
143
 
        {
144
 
          dpos -= woff;
145
 
--- 1864,1872 ----
146
 
         prompt string, since they're both buffer indices and DPOS is a
147
 
         desired display position. */
148
 
!       if ((new > prompt_last_invisible) ||            /* XXX - don't use woff here */
149
 
!         (prompt_physical_chars > _rl_screenwidth &&
150
 
!          _rl_last_v_pos == prompt_last_screen_line &&
151
 
!          wrap_offset != woff &&
152
 
!          new > (prompt_last_invisible-_rl_screenwidth-wrap_offset)))
153
 
        {
154
 
          dpos -= woff;
155
 
*** ../bash-3.2/patchlevel.h    Thu Apr 13 08:31:04 2006
156
 
--- patchlevel.h        Mon Oct 16 14:22:54 2006
157
 
***************
158
 
*** 26,30 ****
159
 
     looks for to find the patch level (for the sccs version string). */
160
 
  
161
 
! #define PATCHLEVEL 43
162
 
  
163
 
  #endif /* _PATCHLEVEL_H_ */
164
 
--- 26,30 ----
165
 
     looks for to find the patch level (for the sccs version string). */
166
 
  
167
 
! #define PATCHLEVEL 44
168
 
  
169
 
  #endif /* _PATCHLEVEL_H_ */