BSD 4_4 release
[unix-history] / usr / src / usr.bin / f77 / libU77 / getcwd_.c
index 174fbca..a9b0831 100644 (file)
@@ -1,5 +1,17 @@
+/*-
+ * Copyright (c) 1980 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This module is believed to contain source code proprietary to AT&T.
+ * Use and redistribution is subject to the Berkeley Software License
+ * Agreement and your Software Agreement with AT&T (Western Electric).
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)getcwd_.c  5.2 (Berkeley) 4/12/91";
+#endif /* not lint */
+
 /*
 /*
-char id_getcwd[] = "@(#)getcwd_.c      1.4";
  * Get pathname of current working directory.
  *
  * calling sequence:
  * Get pathname of current working directory.
  *
  * calling sequence:
@@ -10,6 +22,11 @@ char id_getcwd[] = "@(#)getcwd_.c    1.4";
  *     ierr will be 0 if successful, a system error code otherwise.
  */
 
  *     ierr will be 0 if successful, a system error code otherwise.
  */
 
+#include <sys/param.h>
+#ifndef        MAXPATHLEN
+#define MAXPATHLEN     128
+#endif
+
 extern int errno;
 char   *getwd();
 
 extern int errno;
 char   *getwd();
 
@@ -19,7 +36,7 @@ char *path;
 long len;
 {
        char    *p;
 long len;
 {
        char    *p;
-       char    pathname[1024];
+       char    pathname[MAXPATHLEN];
 
        p = getwd(pathname);
        b_char(pathname, path, len);
 
        p = getwd(pathname);
        b_char(pathname, path, len);