This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] normalize_posix_path and c:/foo/bar
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin-patches at cygwin dot com
- Date: Sun, 16 Mar 2008 00:23:43 -0700
- Subject: [PATCH] normalize_posix_path and c:/foo/bar
- Reply-to: cygwin-patches at cygwin dot com
There's a small buglet in normalize_posix_path in that it doesn't see
c:/foo/bar type paths as being win32 and so it treats them as a relative
path and prepends cwd. Things go downhill from there. The testcase
that exposed this was insight failing to load because some of the tcl
parts use win32 paths, but really a reduced testcase is simply
open("c:/cygwin/bin/ls.exe", O_RDONLY) = ENOENT.
Brian
2008-03-16 Brian Dessent <brian@dessent.net>
* path.cc (normalize_posix_path): Correctly identify a win32
path beginning with a drive letter and forward slashes.
path.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.479
diff -u -p -r1.479 path.cc
--- path.cc 12 Mar 2008 16:07:04 -0000 1.479
+++ path.cc 16 Mar 2008 07:18:41 -0000
@@ -253,7 +253,7 @@ normalize_posix_path (const char *src, c
char *dst_start = dst;
syscall_printf ("src %s", src);
- if ((isdrive (src) && src[2] == '\\') || *src == '\\')
+ if ((isdrive (src) && (src[2] == '\\' || isslash (src[2]))) || *src == '\\')
goto win32_path;
tail = dst;