diff options
author | 2005-05-28 00:41:13 +0000 | |
---|---|---|
committer | 2005-05-28 00:41:13 +0000 | |
commit | 7322bcb7713d965de58542ed9da844aaccee312a (patch) | |
tree | 567da6986c0290c1cafdb1e31bc4920825c6f6fe | |
parent | Step 3 in fixing bioctl commands intermixed with regular io. (diff) | |
download | wireguard-openbsd-7322bcb7713d965de58542ed9da844aaccee312a.tar.xz wireguard-openbsd-7322bcb7713d965de58542ed9da844aaccee312a.zip |
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
-rw-r--r-- | usr.bin/mg/echo.c | 8 |
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; |