From 1537833022ff21d3056483919cfc0ec054c73b55 Mon Sep 17 00:00:00 2001 From: Vincent Labrecque Date: Thu, 22 Jul 2004 01:25:26 +0000 Subject: 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! --- usr.bin/mg/dir.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'usr.bin/mg/dir.c') 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) { -- cgit v1.2.3