OSDN Git Service

* path.cc (getcwd): Allow len == 0 when buf == NULL.
authorcorinna <corinna>
Fri, 19 Oct 2001 19:17:04 +0000 (19:17 +0000)
committercorinna <corinna>
Fri, 19 Oct 2001 19:17:04 +0000 (19:17 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 5a8ed18..ccb4a82 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-19  Corinna Vinschen  <corinna@vinschen.de>
+
+       * path.cc (getcwd): Allow len == 0 when buf == NULL.
+
 2001-10-18  Christopher Faylor  <cgf@redhat.com>
 
        * syscalls.cc (_read): Validate input pointer.
index 317b3a6..066ef2e 100644 (file)
@@ -3120,7 +3120,7 @@ char *
 getcwd (char *buf, size_t ulen)
 {
   char* res = NULL;
-  if (ulen == 0)
+  if (ulen == 0 && buf)
     set_errno (EINVAL);
   else if (buf == NULL || !__check_null_invalid_struct_errno (buf, ulen))
     res = cygheap->cwd.get (buf, 1, 1, ulen);