diff options
author | Eric Blake <eblake@redhat.com> | 2011-04-27 20:40:21 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2011-04-27 20:51:13 -0600 |
commit | 8585ce2ff5698c650ba5d5e3bb99763654ad62e8 (patch) | |
tree | 189d24f11106e82a4c4f8c7bc661ffcea23214ad /lib | |
parent | 2cd4d6d9023e923d6e5da19e8ced3e03290efa78 (diff) | |
download | gnulib-8585ce2ff5698c650ba5d5e3bb99763654ad62e8.tar.gz |
getcwd: fix mingw bugs
On mingw, getcwd(NULL,1) succeeds, even though glibc documents that
with a non-zero size, the allocation will not exceed that many bytes.
On mingw, getcwd has the wrong signature. However, we don't have
to check for this if anything else triggers the replacement.
Also, fix a type bug that crept into the original getcwd-lgpl commit.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Detect one mingw bug.
* doc/posix-functions/getcwd.texi (getcwd): Document the problems.
* lib/getcwd-lgpl.c (rpl_getcwd): Fix return type.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getcwd-lgpl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/getcwd-lgpl.c b/lib/getcwd-lgpl.c index a5596f8869..53c5562357 100644 --- a/lib/getcwd-lgpl.c +++ b/lib/getcwd-lgpl.c @@ -53,7 +53,7 @@ rpl_getcwd (char *buf, size_t size) if (!buf) { errno = ENOMEM; - return -1; + return NULL; } result = getcwd (buf, size); if (!result) |