From 6c057e82df0c5cc7291e7e81b679f7dcaccb131a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 3 Dec 2000 05:16:33 +0000 Subject: * Makefile.in: Use CXX to build the DLL. * configure.in: Find correct c++ compiler. * configure: Regenerate. * path.cc (normalize_posix_path): Put correct drive at beginning of \foo style paths. (chdir): Don't send non-posix path to cygcwd.set. --- winsup/cygwin/path.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 060bb9a4e..8e392d772 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -713,11 +713,13 @@ normalize_win32_path (const char *src, char *dst) char *dst_start = dst; char *dst_root_start = dst; - if (!SLASH_P (src[0]) && strchr (src, ':') == NULL) + if (strchr (src, ':') == NULL) { if (!cygcwd.get (dst, 0)) return get_errno (); - if (strlen (dst) + 1 + strlen (src) >= MAX_PATH) + if (SLASH_P (src[0])) + dst[2] = '\0'; + else if (strlen (dst) + 1 + strlen (src) >= MAX_PATH) { debug_printf ("ENAMETOOLONG = normalize_win32_path (%s)", src); return ENAMETOOLONG; @@ -2557,7 +2559,7 @@ chdir (const char *dir) if (res == -1) __seterrno (); else - cygcwd.set (path, dir); + cygcwd.set (path, strpbrk (dir, ":\\") != NULL ? NULL : dir); /* Note that we're accessing cwd.posix without a lock here. I didn't think it was worth locking just for strace. */ -- cgit v1.2.3