]> code.delx.au - gnu-emacs/commitdiff
*** empty log message ***
authorJim Blandy <jimb@redhat.com>
Fri, 25 Oct 1991 18:59:47 +0000 (18:59 +0000)
committerJim Blandy <jimb@redhat.com>
Fri, 25 Oct 1991 18:59:47 +0000 (18:59 +0000)
src/scroll.c

index 635ca22655e593e527a82ddfadf62ea9ae6e446f..7432a3ea06c5f3d81748ce21e26a9848cba92861 100644 (file)
@@ -447,14 +447,14 @@ scroll_cost (screen, from, to, amount)
   int offset;
   int height = SCREEN_HEIGHT (screen);
 
-  if (amount > 0)
-    limit += amount;
-  if (! scroll_region_ok)
-    limit = height;
-
   if (amount == 0)
     return 0;
 
+  if (! scroll_region_ok)
+    limit = height;
+  else if (amount > 0)
+    limit += amount;
+
   if (amount < 0)
     {
       int temp = to;
@@ -487,7 +487,7 @@ line_ins_del (screen, ov1, pf1, ovn, pfn, ov, mf)
   register int insert_overhead = ov1 * 10;
   register int next_insert_cost = ovn * 10;
 
-  for (i = 0; i <= screen_height; i++)
+  for (i = 0; i < screen_height; i++)
     {
       mf[screen_height - i] = next_insert_cost / 10;
       next_insert_cost += pfn;