From: "U.Nakamura" Date: 2007-02-01T19:34:05+09:00 Subject: [ruby-dev:30237] load script with binmode こんにちは、なかむら(う)です。 Golfってて気付いたのですが、Windowsではスクリプト中に\032(^Z) が含まれていると、そこでスクリプトの読み込みが終了してしまい ます。 そんなスクリプトを書く/使うことは滅多にないとは思いますが、い ちおうパッチです。 Index: iseq.c =================================================================== --- iseq.c (revision 11607) +++ iseq.c (working copy) @@ -424,7 +424,7 @@ rb_scan_args(argc, argv, "11", &file, &opt); fname = StringValueCStr(file); - f = rb_file_open(fname, "r"); + f = rb_file_open(fname, "rb"); parser = rb_parser_new(); node = rb_parser_compile_file(parser, fname, f, NUM2INT(line)); Index: ruby.c =================================================================== --- ruby.c (revision 11607) +++ ruby.c (working copy) @@ -909,7 +909,7 @@ } fclose(fp); - f = rb_file_open(fname, "r"); + f = rb_file_open(fname, "rb"); #if defined DOSISH || defined __CYGWIN__ { char *ext = strrchr(fname, '.'); それでは。 -- U.Nakamura