You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/screen/files/screen-4.3.1-ansi.c.patch

38 lines
657 B

--- a/ansi.c
+++ b/ansi.c
@@ -2502,13 +2502,13 @@
return;
if (n > 0)
{
+ if (ye - ys + 1 < n)
+ n = ye - ys + 1;
if (n > 256)
{
MScrollV(p, n - 256, ys, ye, bce);
n = 256;
}
- if (ye - ys + 1 < n)
- n = ye - ys + 1;
#ifdef COPY_PASTE
if (compacthist)
{
@@ -2562,15 +2562,14 @@
}
else
{
+ n = -n;
+ if (ye - ys + 1 < n)
+ n = ye - ys + 1;
if (n < -256)
{
MScrollV(p, n + 256, ys, ye, bce);
n = -256;
}
- n = -n;
- if (ye - ys + 1 < n)
- n = ye - ys + 1;
-
ml = p->w_mlines + ye;
/* Clear lines */
for (i = ye; i > ye - n; i--, ml--)