Mercurial > cpython-lru_cache-weakref
diff Python/getcwd.c @ 1848:b724599401ff legacy-trunk
Merge back to main trunk
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 30 Aug 1994 08:27:36 +0000 |
| parents | cd397266dc1c |
| children | d0d0a69b5ca3 |
line wrap: on
line diff
--- a/Python/getcwd.c Tue Aug 30 08:19:36 1994 +0000 +++ b/Python/getcwd.c Tue Aug 30 08:27:36 1994 +0000 @@ -1,5 +1,5 @@ /*********************************************************** -Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, +Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved @@ -25,16 +25,20 @@ /* Two PD getcwd() implementations. Author: Guido van Rossum, CWI Amsterdam, Jan 1991, <guido@cwi.nl>. */ -/* #define NO_GETWD /* Turn this on to popen pwd instead of calling getwd() */ - #include <stdio.h> #include <errno.h> -#ifndef NO_GETWD +#ifdef HAVE_GETWD + +/* Version for BSD systems -- use getwd() */ -/* Default: Version for BSD systems -- use getwd() */ +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif -#include "sys/param.h" +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif extern char *getwd(); @@ -63,11 +67,13 @@ return buf; } -#else +#else /* !HAVE_GETWD */ + +/* Version for really old UNIX systems -- use pipe from pwd */ -/* NO_GETWD defined: Version for backward UNIXes -- popen /bin/pwd */ - +#ifndef PWD_CMD #define PWD_CMD "/bin/pwd" +#endif char * getcwd(buf, size) @@ -97,4 +103,4 @@ return buf; } -#endif +#endif /* !HAVE_GETWD */
