]> code.delx.au - gnu-emacs/commitdiff
(compute_motion): Fix boundary case.
authorKarl Heuer <kwzh@gnu.org>
Sat, 12 Jun 1999 03:50:37 +0000 (03:50 +0000)
committerKarl Heuer <kwzh@gnu.org>
Sat, 12 Jun 1999 03:50:37 +0000 (03:50 +0000)
src/indent.c

index 9528894baf2fd8b1ed0dc0bb70c53f9d8d8981e5..5e5c1a0a68d4167ae3e2ff540f14cc3d448ee230 100644 (file)
@@ -1418,7 +1418,9 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
                      /* Skip any number of invisible lines all at once */
                      do
                        {
-                         pos = find_before_next_newline (pos, to, 1) + 1;
+                         pos = find_before_next_newline (pos, to, 1);
+                         if (pos < to)
+                           pos++;
                          pos_byte = CHAR_TO_BYTE (pos);
                        }
                      while (pos < to