projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEWS.stable: log cherry-pick [90a660c]->[e916d00] autoupdate
[gnulib.git]
/
lib
/
getcwd.c
diff --git
a/lib/getcwd.c
b/lib/getcwd.c
index
e52af18
..
cf15521
100644
(file)
--- a/
lib/getcwd.c
+++ b/
lib/getcwd.c
@@
-57,8
+57,6
@@
# endif
#endif
# endif
#endif
-#include <limits.h>
-
#ifndef MAX
# define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
#ifndef MAX
# define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
@@
-66,12
+64,12
@@
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
+#include "pathmax.h"
+
+/* In this file, PATH_MAX only serves as a threshold for choosing among two
+ algorithms. */
#ifndef PATH_MAX
#ifndef PATH_MAX
-# ifdef MAXPATHLEN
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif
+# define PATH_MAX 8192
#endif
#if D_INO_IN_DIRENT
#endif
#if D_INO_IN_DIRENT
@@
-148,7
+146,7
@@
__getcwd (char *buf, size_t size)
# undef getcwd
dir = getcwd (buf, size);
# undef getcwd
dir = getcwd (buf, size);
- if (dir)
+ if (dir
|| (size && errno == ERANGE)
)
return dir;
/* Solaris getcwd (NULL, 0) fails with errno == EINVAL, but it has
return dir;
/* Solaris getcwd (NULL, 0) fails with errno == EINVAL, but it has