=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/paragraph.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- src/usr.bin/mg/paragraph.c 2014/10/12 18:09:41 1.32 +++ src/usr.bin/mg/paragraph.c 2014/10/13 21:01:05 1.33 @@ -1,4 +1,4 @@ -/* $OpenBSD: paragraph.c,v 1.32 2014/10/12 18:09:41 lum Exp $ */ +/* $OpenBSD: paragraph.c,v 1.33 2014/10/13 21:01:05 lum Exp $ */ /* This file is in the public domain. */ @@ -92,6 +92,10 @@ curwp->w_dotline++; } } + /* covers corner case of no '\n' at end of buffer */ + if (lforw(curwp->w_dotp) == curbp->b_headp) + gotoeol(FFRAND, 1); + /* force screen update */ curwp->w_rflag |= WFMOVE; return (TRUE);