[前][次][番号順一覧][スレッド一覧]

ruby-changes:42010

From: nobu <ko1@a...>
Date: Fri, 11 Mar 2016 12:30:31 +0900 (JST)
Subject: [ruby-changes:42010] nobu:r54084 (trunk): Revert r54082 "ruby.c: load in binary mode"

nobu	2016-03-11 12:30:25 +0900 (Fri, 11 Mar 2016)

  New Revision: 54084

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54084

  Log:
    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.

  Modified files:
    trunk/ruby.c
Index: ruby.c
===================================================================
--- ruby.c	(revision 54083)
+++ ruby.c	(revision 54084)
@@ -1846,15 +1846,12 @@ 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
-	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;
 	    }
 	}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]