=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/echo.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- src/usr.bin/mg/echo.c 2021/03/01 10:51:14 1.67 +++ src/usr.bin/mg/echo.c 2021/03/02 15:03:35 1.68 @@ -1,4 +1,4 @@ -/* $OpenBSD: echo.c,v 1.67 2021/03/01 10:51:14 lum Exp $ */ +/* $OpenBSD: echo.c,v 1.68 2021/03/02 15:03:35 lum Exp $ */ /* This file is in the public domain. */ @@ -336,8 +336,8 @@ } if (!dynbuf && epos + 1 >= nbuf) { dobeep(); - ewprintf("Line too long"); - return (emptyval); + ewprintf("Line too long. Press Control-g to escape."); + goto skipkey; } for (t = epos; t > cpos; t--) buf[t] = buf[t - 1]; @@ -492,8 +492,8 @@ } if (!dynbuf && epos + 1 >= nbuf) { dobeep(); - ewprintf("Line too long"); - return (emptyval); + ewprintf("Line too long. Press Control-g to escape."); + goto skipkey; } for (i = epos; i > cpos; i--) buf[i] = buf[i - 1]; @@ -507,6 +507,9 @@ ttmove(rr, cc); ttflush(); } + +skipkey: /* ignore key press */ +; } done: if (cwin == TRUE) {