diff -Nru readline-7.0/debian/changelog readline-7.0/debian/changelog --- readline-7.0/debian/changelog 2017-05-15 20:00:23.000000000 +0000 +++ readline-7.0/debian/changelog 2021-08-13 05:10:56.000000000 +0000 @@ -1,3 +1,10 @@ +readline (7.0-4) unstable; urgency=medium + + * Backport part of code from 8.0 Closes: #1921658 + - Fix issue that MAAS 2.8 returns broken result from virsh console + + -- Seyeong Kim Fri, 13 Aug 2021 05:10:56 +0000 + readline (7.0-3) unstable; urgency=medium * Apply upstream patches 002 and 003. Closes: #852750. diff -Nru readline-7.0/debian/patches/fix-maas-issue.diff readline-7.0/debian/patches/fix-maas-issue.diff --- readline-7.0/debian/patches/fix-maas-issue.diff 1970-01-01 00:00:00.000000000 +0000 +++ readline-7.0/debian/patches/fix-maas-issue.diff 2021-08-13 05:10:56.000000000 +0000 @@ -0,0 +1,73 @@ ++Description: Fix maas 2.8 issue when composing kvm host ++ MAAS 2.8 has issue that when compose kvm host, ++ pexpect ( which seems to use readline library ) returns ++ weird result, it returns broken result includes command itself. ++Author: Chet Ramey (chet.ramey@case.edu) ++Origin: upstream, https://git.savannah.gnu.org/cgit/readline.git/commit/?id=8e6ccd0373d77b86ed37a9a7d232ccfea3d6670c ++Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921658 ++--- ++This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: readline-7.0/display.c +=================================================================== +--- readline-7.0.orig/display.c ++++ readline-7.0/display.c +@@ -304,6 +304,8 @@ prompt_modestr (lenp) + PMT_MULTILINE caller indicates that this is part of a multiline prompt + */ + ++static int *local_prompt_newlines; ++ + static char * + expand_prompt (pmt, flags, lp, lip, niflp, vlp) + char *pmt; +@@ -313,6 +315,7 @@ expand_prompt (pmt, flags, lp, lip, nifl + char *r, *ret, *p, *igstart, *nprompt, *ms; + int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; + int mlen; ++ int mb_cur_max; + + /* We only expand the mode string for the last line of a multiline prompt + (a prompt with embedded newlines). */ +@@ -327,20 +330,30 @@ expand_prompt (pmt, flags, lp, lip, nifl + else + nprompt = pmt; + +- /* Short-circuit if we can. */ +- if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (nprompt, RL_PROMPT_START_IGNORE) == 0) ++ mb_cur_max = MB_CUR_MAX; ++ if (_rl_screenwidth == 0) ++ _rl_get_screen_size (0, 0); /* avoid division by zero */ ++ ++ if ((mb_cur_max <= 1 || rl_byte_oriented) && strchr (nprompt, RL_PROMPT_START_IGNORE) == 0) + { + r = (nprompt == pmt) ? savestring (pmt) : nprompt; +- +- if (lp) +- *lp = strlen (r); +- if (lip) +- *lip = 0; +- if (niflp) +- *niflp = 0; +- if (vlp) +- *vlp = lp ? *lp : strlen (r); +- return r; ++ l = strlen (nprompt); ++ if (l < (_rl_screenwidth > 0 ? _rl_screenwidth : 80)) ++ { ++ r = (nprompt == pmt) ? savestring (pmt) : nprompt; ++ if (lp) ++ *lp = l; ++ if (lip) ++ *lip = 0; ++ if (niflp) ++ *niflp = 0; ++ if (vlp) ++ *vlp = l; ++ local_prompt_newlines = (int *) xrealloc (local_prompt_newlines, sizeof (int) * 2); ++ local_prompt_newlines[0] = 0; ++ local_prompt_newlines[1] = -1; ++ return r; ++ } + } + + l = strlen (nprompt); /* XXX */ diff -Nru readline-7.0/debian/patches/series readline-7.0/debian/patches/series --- readline-7.0/debian/patches/series 2017-05-15 19:58:33.000000000 +0000 +++ readline-7.0/debian/patches/series 2021-08-13 05:10:56.000000000 +0000 @@ -13,3 +13,4 @@ fix-wformat-security.diff configure-tinfo.diff rlfe-signal-rvt.diff +fix-maas-issue.diff