summaryrefslogtreecommitdiff
path: root/usr.bin/mg/modes.c
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2004-07-22 01:25:26 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2004-07-22 01:25:26 +0000
commit1537833022ff21d3056483919cfc0ec054c73b55 (patch)
tree9ee77c6b0ac08f47824fbe6f2b6922687f72d581 /usr.bin/mg/modes.c
parentc93686e4f60cff949f0e9b42fa716e5e5c8fd604 (diff)
stage 1 of the infinite minibuffer work - add support for on the fly
buffer reallocation in veread(). This commit only changes the API. All the buffers have exactly the same bounds as before for now. tested by a couple of my very helpful testers!
Diffstat (limited to 'usr.bin/mg/modes.c')
-rw-r--r--usr.bin/mg/modes.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mg/modes.c b/usr.bin/mg/modes.c
index 842a074bb96..9ab31267a0b 100644
--- a/usr.bin/mg/modes.c
+++ b/usr.bin/mg/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.8 2002/07/01 14:33:44 vincent Exp $ */
+/* $OpenBSD: modes.c,v 1.9 2004/07/22 01:25:25 vincent Exp $ */
/*
* Commands to toggle modes. Without an argument, these functions will
@@ -115,10 +115,12 @@ set_default_mode(int f, int n)
{
int i;
MAPS *m;
- char mode[32];
+ char mode[32], *bufp;
- if (eread("Set Default Mode: ", mode, 32, EFNEW) != TRUE)
+ if ((bufp = eread("Set Default Mode: ", mode, 32, EFNEW)) == NULL)
return ABORT;
+ else if (bufp[0] == '\0')
+ return FALSE;
if ((m = name_mode(mode)) == NULL) {
ewprintf("can't find mode %s", mode);
return FALSE;