summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-14 22:16:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-14 22:16:12 +0000
commit980a954f11396afc082875684037505c846d54ab (patch)
tree795a14cd2c3884847859d97142cca2928e934a7a /file.c
parent32ed00ab188cf46d0d4bae116a48dac91731af32 (diff)
* file.c (FILE_ALT_SEPARATOR): separated condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/file.c b/file.c
index ce984f395b..557e232c84 100644
--- a/file.c
+++ b/file.c
@@ -2491,7 +2491,10 @@ rb_file_s_umask(int argc, VALUE *argv)
#if defined __CYGWIN__ || defined DOSISH
#define DOSISH_UNC
#define DOSISH_DRIVE_LETTER
-#define isdirsep(x) ((x) == '/' || (x) == '\\')
+#define FILE_ALT_SEPARATOR '\\'
+#endif
+#ifdef FILE_ALT_SEPARATOR
+#define isdirsep(x) ((x) == '/' || (x) == FILE_ALT_SEPARATOR)
#else
#define isdirsep(x) ((x) == '/')
#endif
@@ -5098,8 +5101,8 @@ Init_File(void)
rb_define_singleton_method(rb_cFile, "split", rb_file_s_split, 1);
rb_define_singleton_method(rb_cFile, "join", rb_file_s_join, -2);
-#ifdef DOSISH
- rb_define_const(rb_cFile, "ALT_SEPARATOR", rb_obj_freeze(rb_usascii_str_new2("\\")));
+#ifdef FILE_ALT_SEPARATOR
+ rb_define_const(rb_cFile, "ALT_SEPARATOR", rb_obj_freeze(rb_usascii_str_new2(file_alt_separator)));
#else
rb_define_const(rb_cFile, "ALT_SEPARATOR", Qnil);
#endif