summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-07-31 10:26:51 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-07-31 10:26:51 +0000
commitfd5f6eb13e2a058f9cc840e44e64d420fce7dc58 (patch)
tree810ddf200cf0972329b113730b4c8055085a2d7e
parent7df2c73d5dd6f7e029a5ecf2f348aad891f9b962 (diff)
downloadcygnal-fd5f6eb13e2a058f9cc840e44e64d420fce7dc58.tar.gz
cygnal-fd5f6eb13e2a058f9cc840e44e64d420fce7dc58.tar.bz2
cygnal-fd5f6eb13e2a058f9cc840e44e64d420fce7dc58.zip
* path.cc (normalize_posix_path): Don't check existence of / or // dir
in parent dir check.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/path.cc13
2 files changed, 13 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bdabb21a4..1c8bc5a76 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-31 Corinna Vinschen <corinna@vinschen.de>
+
+ * path.cc (normalize_posix_path): Don't check existence of / or // dir
+ in parent dir check.
+
2013-07-26 Christopher Faylor <me.cygwin2013@cgf.cx>
* environ.cc (tty_is_gone): Delete.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 7f0e5b81f..8acb6ff6b 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -311,11 +311,14 @@ normalize_posix_path (const char *src, char *dst, char *&tail)
double check in case of foo/bar/../.. */
if (check_parent)
{
- *tail = 0;
- debug_printf ("checking %s before '..'", dst);
- path_conv head (dst);
- if (!head.isdir())
- return ENOENT;
+ if (tail > dst_start) /* Don't check for / or // dir. */
+ {
+ *tail = 0;
+ debug_printf ("checking %s before '..'", dst);
+ path_conv head (dst);
+ if (!head.isdir())
+ return ENOENT;
+ }
check_parent = false;
}
while (tail > dst_start && !isslash (*--tail))