From 82491559bfea304e93d5f5d00e72ced181619be6 Mon Sep 17 00:00:00 2001 From: cgf Date: Sat, 24 Nov 2001 21:04:59 +0000 Subject: [PATCH] * path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid matching trailing component, like other devices. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 19 ++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 72bbbda79f..9c44cb2215 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2001-11-24 Christopher Faylor + * path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid + matching trailing component, like other devices. + +2001-11-24 Christopher Faylor + * autoload.cc (IsDebuggerPresent): Make conditional load since it is not available everywhere. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 8e1775c3c6..af30927c0e 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. */ } -- 2.11.0