-/* $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. */
}
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];
}
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];
ttmove(rr, cc);
ttflush();
}
+
+skipkey: /* ignore key press */
+;
}
done:
if (cwin == TRUE) {