diff -u bash-3.2/debian/rules bash-3.2/debian/rules --- bash-3.2/debian/rules +++ bash-3.2/debian/rules @@ -555,6 +555,7 @@ bash-subst-param-length \ pgrp-pipe \ input-err \ + forced-update-display \ ifeq ($(with_gfdl),yes) debian_patches += \ diff -u bash-3.2/debian/changelog bash-3.2/debian/changelog --- bash-3.2/debian/changelog +++ bash-3.2/debian/changelog @@ -1,3 +1,11 @@ +bash (3.2-0ubuntu12) gutsy; urgency=low + + * Fix offset error with autocompletion (with color+newline in PS1) + - debian/forced-update-display.dpatch + - LP: #119938 + + -- dAniel hAhler Fri, 12 Oct 2007 03:49:36 +0200 + bash (3.2-0ubuntu11) gutsy; urgency=low * Move CWRU/changelog from the bash to the bash-doc package (we already only in patch2: unchanged: --- bash-3.2.orig/debian/patches/forced-update-display.dpatch +++ bash-3.2/debian/patches/forced-update-display.dpatch @@ -0,0 +1,72 @@ +#! /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 -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: Fix "Offset error with autocompletion (with color+newline in PS1)" +# See https://launchpad.net/bugs/119938 (patch from Chet Ramey) + +*** bash-3.2.25/lib/readline/display.c Mon Aug 6 14:26:29 2007 +--- bash-3.2.25.fixed/lib/readline/display.c Wed Oct 10 22:43:58 2007 +*************** +*** 1049,1053 **** + else + tx = nleft; +! if (_rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ +--- 1049,1053 ---- + else + tx = nleft; +! if (tx >= 0 && _rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ +*************** +*** 1205,1209 **** + { + register char *ofd, *ols, *oe, *nfd, *nls, *ne; +! int temp, lendiff, wsatend, od, nd; + int current_invis_chars; + int col_lendiff, col_temp; +--- 1205,1209 ---- + { + register char *ofd, *ols, *oe, *nfd, *nls, *ne; +! int temp, lendiff, wsatend, od, nd, o_cpos; + int current_invis_chars; + int col_lendiff, col_temp; +*************** +*** 1466,1469 **** +--- 1466,1471 ---- + } + ++ o_cpos = _rl_last_c_pos; ++ + /* When this function returns, _rl_last_c_pos is correct, and an absolute + cursor postion in multibyte mode, but a buffer index when not in a +*************** +*** 1475,1479 **** + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ +! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; + #endif +--- 1477,1483 ---- + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ +! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && +! (_rl_last_c_pos > 0 || o_cpos > 0) && +! _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; + #endif