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
This commit is contained in:
parent
50dd73582e
commit
a2b88f5325
7
ruby.c
7
ruby.c
@ -1846,15 +1846,12 @@ open_load_file(VALUE fname_v, int *xflag)
|
|||||||
#else
|
#else
|
||||||
# define MODE_TO_LOAD (O_RDONLY)
|
# define MODE_TO_LOAD (O_RDONLY)
|
||||||
#endif
|
#endif
|
||||||
const int mode =
|
int mode = MODE_TO_LOAD;
|
||||||
#ifdef O_BINARY
|
|
||||||
O_BINARY |
|
|
||||||
#endif
|
|
||||||
MODE_TO_LOAD;
|
|
||||||
#if defined DOSISH || defined __CYGWIN__
|
#if defined DOSISH || defined __CYGWIN__
|
||||||
{
|
{
|
||||||
const char *ext = strrchr(fname, '.');
|
const char *ext = strrchr(fname, '.');
|
||||||
if (ext && STRCASECMP(ext, ".exe") == 0) {
|
if (ext && STRCASECMP(ext, ".exe") == 0) {
|
||||||
|
mode |= O_BINARY;
|
||||||
*xflag = 1;
|
*xflag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user