summaryrefslogtreecommitdiffstats
path: root/Python/getcwd.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-30 08:27:36 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-30 08:27:36 (GMT)
commit1d5735e84621a7fe68d361fa0e289fa2c3310836 (patch)
tree4ee6f32fa4743f4c6641b04131e449bc71a5ea25 /Python/getcwd.c
parent013142a95fd63a05d09cec7b36b7c86cc98e30c1 (diff)
downloadcpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.zip
cpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.tar.gz
cpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.tar.bz2
Merge back to main trunk
Diffstat (limited to 'Python/getcwd.c')
-rw-r--r--Python/getcwd.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/Python/getcwd.c b/Python/getcwd.c
index e3c3bfc..05b58bc 100644
--- a/Python/getcwd.c
+++ b/Python/getcwd.c
@@ -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 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* 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 @@ getcwd(buf, size)
return buf;
}
-#else
+#else /* !HAVE_GETWD */
-/* NO_GETWD defined: Version for backward UNIXes -- popen /bin/pwd */
+/* Version for really old UNIX systems -- use pipe from pwd */
+#ifndef PWD_CMD
#define PWD_CMD "/bin/pwd"
+#endif
char *
getcwd(buf, size)
@@ -97,4 +103,4 @@ getcwd(buf, size)
return buf;
}
-#endif
+#endif /* !HAVE_GETWD */