summaryrefslogtreecommitdiff
path: root/usr.bin/mg/echo.c
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-05-28 00:41:14 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-05-28 00:41:14 +0000
commit8741d6533d128f7f696f777bb21921020d4f9d8e (patch)
tree721510ead16df1a0cf9574dce06a7b54f72edb55 /usr.bin/mg/echo.c
parentcd15987d091a8d0c5fd8cffcbb2ba1af17bb6269 (diff)
If the user gets into a minibuffer, they will not know how to hit
Ctrl+g to get out of it. Let them hit enter, like in emacs. OK kjell, jason
Diffstat (limited to 'usr.bin/mg/echo.c')
-rw-r--r--usr.bin/mg/echo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c
index 29c26e341a1..206f3d90619 100644
--- a/usr.bin/mg/echo.c
+++ b/usr.bin/mg/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.32 2005/04/28 07:23:56 otto Exp $ */
+/* $OpenBSD: echo.c,v 1.33 2005/05/28 00:41:13 cloder Exp $ */
/*
* Echo line reading and writing.
*
@@ -202,6 +202,12 @@ veread(const char *fp, char *buf, size_t nbuf, int flag, va_list ap)
c = CCHR('M');
/* FALLTHROUGH */
case CCHR('M'): /* return, done */
+ /* if there's nothing in the minibuffer, quit */
+ if (cpos == 0) {
+ (void)ctrlg(FFRAND, 0);
+ ttflush();
+ return (NULL);
+ }
if ((flag & EFFUNC) != 0) {
if ((i = complt(flag, c, buf, nbuf, cpos)) == 0)
continue;