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>