diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-01-08 15:07:02 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-01-08 15:07:02 +0000 |
commit | 4497b2b1b70bb1646bb4d62c9f5b410f7a6fe536 (patch) | |
tree | ca342afaef1abf67a5dd7b2c1fee37a02197d6c1 /Src/Zle | |
parent | 174143dd7c2fc1da1668a216028f0657088aa166 (diff) | |
download | zsh-4497b2b1b70bb1646bb4d62c9f5b410f7a6fe536.tar.gz zsh-4497b2b1b70bb1646bb4d62c9f5b410f7a6fe536.tar.xz zsh-4497b2b1b70bb1646bb4d62c9f5b410f7a6fe536.zip |
24371: bug refreshing large scrolling history entry
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/zle_refresh.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index a705f67cf..cdda42287 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -797,7 +797,7 @@ zrefresh(void) (int)ZR_strlen(nbuf[0]) + rpromptw < winw - 1; } else { /* insert >.... on first line if there is more text before start of screen */ - memset(nbuf[0], ZWC(' '), lpromptw); + ZR_memset(nbuf[0], ZWC(' '), lpromptw); t0 = winw - lpromptw; t0 = t0 > 5 ? 5 : t0; ZR_memcpy(nbuf[0] + lpromptw, ZWS(">...."), t0); @@ -1133,6 +1133,15 @@ refreshline(int ln) if (!*ol) { i = (col_cleareol >= 0) ? col_cleareol : nllen; i -= vcs; + if (i < 0) { + /* + * This shouldn't be necessary, but it's better + * than a crash if there's a bug somewhere else, + * so report in debug mode. + */ + DPUTS(1, "BUG: badly calculated old line width in refresh"); + i = 0; + } zwrite(nl, i); vcs += i; if (col_cleareol >= 0) |