about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-04-06 09:25:17 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-04-06 09:25:17 +0000
commit6fa6a1f865b56b1dee05d780c788686db3bd3c2a (patch)
treea1c5b3279db9601e348222f006b5ac0b9b45d382 /Src/builtin.c
parent4688564c0a891a2e3fa73255cf907dd269a62a2e (diff)
downloadzsh-6fa6a1f865b56b1dee05d780c788686db3bd3c2a.tar.gz
zsh-6fa6a1f865b56b1dee05d780c788686db3bd3c2a.tar.xz
zsh-6fa6a1f865b56b1dee05d780c788686db3bd3c2a.zip
Peter Castro: Cygwin improvements for dynamic libraries, text/binary, paths
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 2ae7e9bbf..8703ecead 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -927,7 +927,9 @@ cd_do_chdir(char *cnam, char *dest, int hard)
      * DOS style names with drives in them
      */
     static char buf[PATH_MAX];
+#ifndef _SYS_CYGWIN_H
     void cygwin_conv_to_posix_path(const char *, char *);
+#endif
 
     cygwin_conv_to_posix_path(dest, buf);
     dest = buf;
@@ -1031,7 +1033,15 @@ cd_try_chdir(char *pfix, char *dest, int hard)
     /* handle directory prefix */
     if (pfix && *pfix) {
 	if (*pfix == '/')
+#ifdef __CYGWIN__
+/* NB: Don't turn "/"+"bin" into "//"+"bin" by mistake!  "//bin" may *
+ * not be what user really wants (probably wants "/bin"), but        *
+ * "//bin" could be valid too (see fixdir())!  This is primarily for *
+ * handling CDPATH correctly.                                        */
+	    buf = tricat(pfix, ( pfix[1] == '\0' ? "" : "/" ), dest);
+#else
 	    buf = tricat(pfix, "/", dest);
+#endif
 	else {
 	    int pfl = strlen(pfix);
 	    dlen = strlen(pwd);