summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc20
1 files changed, 5 insertions, 15 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index c636fb547..a9d6292d7 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -655,12 +655,6 @@ path_conv::check (const char *src, unsigned opt,
full_path[3] = '\0';
}
- if ((opt & PC_SYM_IGNORE) && pcheck_case == PCHECK_RELAXED)
- {
- fileattr = GetFileAttributes (this->path);
- goto out;
- }
-
symlen = sym.check (full_path, suff, opt | fs.has_ea ());
if (sym.minor || sym.major)
@@ -706,6 +700,11 @@ path_conv::check (const char *src, unsigned opt,
error = sym.error;
if (component == 0)
add_ext_from_sym (sym);
+ else if (!(sym.fileattr & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ error = ENOTDIR;
+ goto out;
+ }
if (pcheck_case == PCHECK_RELAXED)
goto out; // file found
/* Avoid further symlink evaluation. Only case checks are
@@ -939,15 +938,6 @@ path_conv::~path_conv ()
}
}
-static __inline int
-digits (const char *name)
-{
- char *p;
- int n = strtol (name, &p, 10);
-
- return p > name && !*p ? n : -1;
-}
-
/* Return true if src_path is a valid, internally supported device name.
In that case, win32_path gets the corresponding NT device name and
dev is appropriately filled with device information. */