summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/path.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a6ee4c4d5..1bad769da 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+Fri Oct 5 11:05:32 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * path.cc (getcwd): Allow NULL first argument.
+
Fri Oct 5 00:31:35 2001 Christopher Faylor <cgf@cygnus.com>
* heap.h (inheap): Check for NULL.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index cc9d647dd..25d086fbf 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3011,7 +3011,7 @@ getcwd (char *buf, size_t ulen)
char* res = NULL;
if (ulen == 0)
set_errno (EINVAL);
- else if (!__check_null_invalid_struct_errno (buf, ulen))
+ else if (buf == NULL || !__check_null_invalid_struct_errno (buf, ulen))
res = cygheap->cwd.get (buf, 1, 1, ulen);
return res;
}