getcwd: fix mingw bugs
authorEric Blake <eblake@redhat.com>
Thu, 28 Apr 2011 02:40:21 +0000 (20:40 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 28 Apr 2011 02:51:13 +0000 (20:51 -0600)
commit8585ce2ff5698c650ba5d5e3bb99763654ad62e8
tree189d24f11106e82a4c4f8c7bc661ffcea23214ad
parent2cd4d6d9023e923d6e5da19e8ced3e03290efa78
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>
ChangeLog
doc/posix-functions/getcwd.texi
lib/getcwd-lgpl.c
m4/getcwd.m4