aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-07-09 17:15:38 +0000
committerChristopher Faylor <me@cgf.cx>2005-07-09 17:15:38 +0000
commitf79359a5bc7354bb973396d3592e7b378fea59c1 (patch)
treeee142bfe47711fc3e083522aafe5e1acba7c4ecb /winsup
parent4cc9a82e3ef3e785c720133b737c3713e6582b62 (diff)
downloadnewlib-f79359a5bc7354bb973396d3592e7b378fea59c1.zip
newlib-f79359a5bc7354bb973396d3592e7b378fea59c1.tar.gz
newlib-f79359a5bc7354bb973396d3592e7b378fea59c1.tar.bz2
* path.cc (mount): Only check win32_path when we know we need it.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/path.cc4
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f49a641..edcad89 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-09 Christopher Faylor <cgf@timesys.com>
+
+ * path.cc (mount): Only check win32_path when we know we need it.
+
2005-07-09 Nicholas Wourms <nwourms@gmail.com>
* cygwin.din (getline): Export.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index c62d702..2a5ca46 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2486,7 +2486,7 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
myfault efault;
if (efault.faulted (EFAULT))
/* errno set */;
- else if (!*posix_path || !*win32_path)
+ else if (!*posix_path)
set_errno (EINVAL);
else if (strpbrk (posix_path, "\\:"))
set_errno (EINVAL);
@@ -2498,6 +2498,8 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
res = mount_table->write_cygdrive_info_to_registry (posix_path, flags);
win32_path = NULL;
}
+ else if (!*win32_path)
+ set_errno (EINVAL);
else
res = mount_table->add_item (win32_path, posix_path, flags, true);