Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-06-16 02:14:14 +0400
committerChristopher Faylor <me@cgf.cx>2000-06-16 02:14:14 +0400
commit3875d9e65223107ecc5ee8ce7f6510e092779da9 (patch)
treeb0324c5be0f2a3b71a1df562430437c5cb4567af /winsup
parenta9706abaff4237f0e5ee79b9123e5f03f13e1a41 (diff)
* path.cc (chdir): Don't set cache to offending chdir. Change comment to
reflect current reality.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/path.cc18
2 files changed, 15 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4facd8b4e..a9e3980b0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun 15 18:12:36 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * path.cc (chdir): Don't set cache to offending chdir. Change comment
+ to reflect current reality.
+
Thu Jun 15 15:43:50 2000 Christopher Faylor <cgf@cygnus.com>
* path.cc (normalize_posix_path): Convert path to POSIX if it seems to
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index a74aa0829..4952d4608 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2467,15 +2467,17 @@ chdir (const char *dir)
int res = SetCurrentDirectoryA (native_dir) ? 0 : -1;
if (res == -1)
__seterrno ();
+ else
+ {
+ /* Store new cache information */
+ free (cwd_win32);
+ cwd_win32 = strdup (path);;
- /* Clear the cache until we need to retrieve the directory again. */
- free (cwd_win32);
- cwd_win32 = strdup (path);;
-
- char pathbuf[MAX_PATH];
- (void) normalize_posix_path (cwd_posix, dir, pathbuf);
- free (cwd_posix);
- cwd_posix = strdup (pathbuf);
+ char pathbuf[MAX_PATH];
+ (void) normalize_posix_path (cwd_posix, dir, pathbuf);
+ free (cwd_posix);
+ cwd_posix = strdup (pathbuf);
+ }
syscall_printf ("%d = chdir (%s <dos %s>)", res, cwd_posix, cwd_win32);
return res;