summaryrefslogtreecommitdiff
path: root/usr.bin/mg/dir.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/dir.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/dir.c')
-rw-r--r--usr.bin/mg/dir.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/mg/dir.c b/usr.bin/mg/dir.c
index 27e9b39da5d..52407f72d00 100644
--- a/usr.bin/mg/dir.c
+++ b/usr.bin/mg/dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.c,v 1.10 2004/03/05 22:02:18 vincent Exp $ */
+/* $OpenBSD: dir.c,v 1.11 2004/07/22 01:25:24 vincent Exp $ */
/*
* Name: MG 2a
@@ -33,11 +33,10 @@ dirinit(void)
int
changedir(int f, int n)
{
- int s;
- char bufc[NPAT];
+ char bufc[NPAT], *bufp;
- if ((s = ereply("Change default directory: ", bufc, NPAT)) != TRUE)
- return (s);
+ if ((bufp = ereply("Change default directory: ", bufc, NPAT)) == NULL)
+ return ABORT;
if (bufc[0] == '\0')
(void)strlcpy(bufc, wdir, sizeof bufc);
if (chdir(bufc) == -1) {