From c9faf62a8053e249f3395fc696634da1e020976a Mon Sep 17 00:00:00 2001 From: steve Date: Mon, 23 Dec 1996 05:31:48 +0000 Subject: Don't use _POSIX_PATH_MAX to limit the size of the path, instead use 'getcwd(NULL, 0)' just as pwd(1) does. Suggested by: bde --- bin/sh/cd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/sh/cd.c') diff --git a/bin/sh/cd.c b/bin/sh/cd.c index 15706c6..29f8f6c 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cd.c,v 1.7 1996/12/14 06:19:09 steve Exp $ + * $Id: cd.c,v 1.8 1996/12/21 22:09:38 steve Exp $ */ #ifndef lint @@ -235,11 +235,11 @@ pwdcmd(argc, argv) char * getpwd() { - char buf[_POSIX_PATH_MAX]; + char *buf; if (curdir) return (curdir); - if (getcwd(buf, sizeof(buf)) == NULL) + if ((buf = getcwd(NULL, 0)) == NULL) return (NULL); return ((curdir = savestr(buf))); } -- cgit v1.1