aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-11-24 21:05:00 +0000
committerChristopher Faylor <me@cgf.cx>2001-11-24 21:05:00 +0000
commit28d3cc021d78f7f0867fc7f5f5930369ea94ff5a (patch)
treeb0e5971c3bd1118f3dffc32b95df970d62b59f4a /winsup/cygwin/path.cc
parent3409763ff308ce9a6ee393ba2ac47447ede9fde7 (diff)
downloadnewlib-28d3cc021d78f7f0867fc7f5f5930369ea94ff5a.zip
newlib-28d3cc021d78f7f0867fc7f5f5930369ea94ff5a.tar.gz
newlib-28d3cc021d78f7f0867fc7f5f5930369ea94ff5a.tar.bz2
* path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid matching
trailing component, like other devices.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 8e1775c..af30927 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -482,19 +482,16 @@ path_conv::check (const char *src, unsigned opt,
/* devn should not be a device. If it is, then stop parsing now. */
if (devn != FH_BAD)
{
- if (devn == FH_CYGDRIVE)
- fileattr = !unit ? FILE_ATTRIBUTE_DIRECTORY
- : GetFileAttributes (full_path);
- else
+ if (component)
{
- if (component)
- {
- error = ENOTDIR;
- return;
- }
- fileattr = 0;
+ error = ENOTDIR;
+ return;
}
-
+ if (devn != FH_CYGDRIVE)
+ fileattr = 0;
+ else
+ fileattr = !unit ? FILE_ATTRIBUTE_DIRECTORY
+ : GetFileAttributes (full_path);
goto out; /* Found a device. Stop parsing. */
}