summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-20 10:42:57 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-20 10:42:57 +0000
commit80caadabe9ff062d5da286a2447674ed34d5f56c (patch)
tree665707e9f2b7061d3ae9686b2476915be9726f1b
parentc8c55db68ae5d78d6926b160f5472712cf68993f (diff)
* file.c (rb_file_s_expand_path): accept drive letter on Cygwin.
* file.c (is_absolute_path): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--file.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 28e94601b2..8a4a23f0d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Aug 20 19:39:03 2002 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * file.c (rb_file_s_expand_path): accept drive letter on Cygwin.
+
+ * file.c (is_absolute_path): ditto.
+
Tue Aug 20 12:12:25 2002 Tietew <tietew@tietew.net>
* io.c (rb_io_putc): output via rb_io_write().
diff --git a/file.c b/file.c
index 87f3cc63cc..03bd50227e 100644
--- a/file.c
+++ b/file.c
@@ -1463,7 +1463,7 @@ rb_file_s_expand_path(argc, argv)
#endif
}
}
-#if defined DOSISH
+#if defined DOSISH || defined __CYGWIN__
/* skip drive letter */
else if (ISALPHA(s[0]) && s[1] == ':' && isdirsep(s[2])) {
b = s;
@@ -1561,7 +1561,7 @@ rb_file_s_expand_path(argc, argv)
memcpy(++p, b, s-b);
p += s-b;
}
-#if defined(DOSISH)
+#if defined DOSISH || defined __CYGWIN__
else if (ISALPHA(buf[0]) && (buf[1] == ':') && isdirsep(buf[2])) {
/* root directory needs a trailing backslash,
otherwise it mean the current directory of the drive */
@@ -2318,10 +2318,11 @@ static int
is_absolute_path(path)
const char *path;
{
-#ifdef DOSISH
+#if defined DOSISH || defined __CYGWIN__
if (ISALPHA(path[0]) && path[1] == ':' && isdirsep(path[2])) return 1;
if (isdirsep(path[0]) && isdirsep(path[1])) return 1;
-#else
+#endif
+#ifndef DOSISH
if (path[0] == '/') return 1;
#endif
return 0;