diff options
author | tjr <tjr@FreeBSD.org> | 2002-07-25 09:56:08 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-07-25 09:56:08 +0000 |
commit | cb0dfaa9bd4dafda1b4703343db6d7094eca0691 (patch) | |
tree | f852c606c556baaff228807c2826a0cca4df8dad | |
parent | 077941cfae2790e2bc36780dcd7dd33e43b139b3 (diff) | |
download | FreeBSD-src-cb0dfaa9bd4dafda1b4703343db6d7094eca0691.zip FreeBSD-src-cb0dfaa9bd4dafda1b4703343db6d7094eca0691.tar.gz |
Use PATH_MAX instead of a local guess at it, which happened to be incorrect.
Suggested by: fanf
-rw-r--r-- | bin/sh/cd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c index b10074c..39b466f 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> #include <errno.h> +#include <limits.h> /* * The cd and pwd commands. @@ -316,12 +317,10 @@ updatepwd(char *dir) return (0); } -#define MAXPWD 256 - int pwdcmd(int argc, char **argv) { - char buf[MAXPWD]; + char buf[PATH_MAX]; int ch, phys; optreset = 1; optind = 1; /* initialize getopt */ @@ -365,7 +364,7 @@ pwdcmd(int argc, char **argv) char * getpwd(void) { - char buf[MAXPWD]; + char buf[PATH_MAX]; if (curdir) return curdir; |