summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1996-12-23 05:31:48 +0000
committersteve <steve@FreeBSD.org>1996-12-23 05:31:48 +0000
commitc9faf62a8053e249f3395fc696634da1e020976a (patch)
tree663b7915f2184d52d41d977491061e49bd736f9c /bin
parentb6b474ae72dcd4ef16f9bc2e9c6c5614be245f5f (diff)
downloadFreeBSD-src-c9faf62a8053e249f3395fc696634da1e020976a.zip
FreeBSD-src-c9faf62a8053e249f3395fc696634da1e020976a.tar.gz
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
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/cd.c6
1 files changed, 3 insertions, 3 deletions
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)));
}
OpenPOWER on IntegriCloud