aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-11 03:30:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-11 03:30:25 +0000
commitf0cc30530622b95b31365a2ab2457f551baafcef (patch)
tree9d40c8a41d9c6fc354464b2d117564a335ab2954 /ruby.c
parenta483b329dd6b317f2dae8d25131d17dbcd4c1852 (diff)
downloadruby-f0cc30530622b95b31365a2ab2457f551baafcef.tar.gz
Revert r54082 "ruby.c: load in binary mode"
DATA is expected to be text mode, but there is no ways to make a FD to text mode from binary mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ruby.c b/ruby.c
index b0c6c1cce9..e8633275dc 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1846,15 +1846,12 @@ open_load_file(VALUE fname_v, int *xflag)
#else
# define MODE_TO_LOAD (O_RDONLY)
#endif
- const int mode =
-#ifdef O_BINARY
- O_BINARY |
-#endif
- MODE_TO_LOAD;
+ int mode = MODE_TO_LOAD;
#if defined DOSISH || defined __CYGWIN__
{
const char *ext = strrchr(fname, '.');
if (ext && STRCASECMP(ext, ".exe") == 0) {
+ mode |= O_BINARY;
*xflag = 1;
}
}