ruby-changes:42008
From: nobu <ko1@a...>
Date: Fri, 11 Mar 2016 10:47:25 +0900 (JST)
Subject: [ruby-changes:42008] nobu:r54082 (trunk): ruby.c: load in binary mode
nobu 2016-03-11 10:47:19 +0900 (Fri, 11 Mar 2016) New Revision: 54082 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54082 Log: ruby.c: load in binary mode * ruby.c (open_load_file): always open in binary mode if provided, parser deals with CRs. Modified files: trunk/ruby.c Index: ruby.c =================================================================== --- ruby.c (revision 54081) +++ ruby.c (revision 54082) @@ -1846,12 +1846,15 @@ open_load_file(VALUE fname_v, int *xflag https://github.com/ruby/ruby/blob/trunk/ruby.c#L1846 #else # define MODE_TO_LOAD (O_RDONLY) #endif - int mode = MODE_TO_LOAD; + const int mode = +#ifdef O_BINARY + O_BINARY | +#endif + MODE_TO_LOAD; #if defined DOSISH || defined __CYGWIN__ { const char *ext = strrchr(fname, '.'); if (ext && STRCASECMP(ext, ".exe") == 0) { - mode |= O_BINARY; *xflag = 1; } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/