diff options
author | Christopher Faylor <me@cgf.cx> | 2001-10-07 21:16:36 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-10-07 21:16:36 +0000 |
commit | c27a29813a634f283a405df1165f0010bb10eb74 (patch) | |
tree | e9014a4b71406b3b8b34101fcec0b8f9b7da7730 /winsup | |
parent | 58364ce8a1cbbcf5aafa5e8b41e77dd71bb64110 (diff) | |
download | newlib-c27a29813a634f283a405df1165f0010bb10eb74.zip newlib-c27a29813a634f283a405df1165f0010bb10eb74.tar.gz newlib-c27a29813a634f283a405df1165f0010bb10eb74.tar.bz2 |
* path.cc (normalize_posix_path): Don't eat a '.' after a '\\' since it has
special meaning on NT.
* syscalls.cc (access): Use stat_worker.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 14 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 4 |
3 files changed, 22 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 665ae95..05a7f30 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +Sun Oct 7 17:16:05 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Don't eat a '.' after a '\\' since it + has special meaning on NT. + + * syscalls.cc (access): Use stat_worker. + Fri Oct 5 21:01:14 2001 Christopher Faylor <cgf@cygnus.com> * fhandler.cc (fhandler_base::fork_fixup): Protect dup'ed handle and diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 1688f08..5e00f35 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -209,6 +209,12 @@ normalize_posix_path (const char *src, char *dst) *dst++ = '/'; src = src_start + 1; } + else if (src[0] == '.' && isslash (src[1])) + { + *dst++ = '.'; + *dst++ = '/'; + src += 2; + } } else *dst = '\0'; @@ -934,7 +940,13 @@ normalize_win32_path (const char *src, char *dst) if (beg_src_slash && isdirsep (src[1])) { *dst++ = '\\'; - ++src; + src++; + if (src[1] == '.' && isdirsep (src[2])) + { + *dst++ = '\\'; + *dst++ = '.'; + src += 2; + } } else if (strchr (src, ':') == NULL && *src != '/') { diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index d41cb2b..ebdd767 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1074,7 +1074,7 @@ access (const char *fn, int flags) { sigframe thisframe (mainthread); // flags were incorrectly specified - if (flags & ~ (F_OK|R_OK|W_OK|X_OK)) + if (flags & ~(F_OK|R_OK|W_OK|X_OK)) { set_errno (EINVAL); return -1; @@ -1084,7 +1084,7 @@ access (const char *fn, int flags) return acl_access (fn, flags); struct stat st; - int r = stat (fn, &st); + int r = stat_worker (fn, &st, 0); if (r) return -1; r = -1; |