aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-07 15:44:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-07 15:44:34 +0000
commit99159ae772be6ae5135c34b3abc094bb60301fe8 (patch)
treecf8fdec5307d9026aca5e1023bf46236ca5c74fe
parent87f868fc4c5017430054d1f4d2f5fac92b3f84fa (diff)
downloadruby-99159ae772be6ae5135c34b3abc094bb60301fe8.tar.gz
* ruby.c (warn_cr_in_shebang): meaningless check on DOSISH platforms.
fixed a test failure introduced at r53998. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ruby.c6
-rw-r--r--test/ruby/test_rubyoptions.rb2
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e40bea7cc..cc8c2dbd55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Mar 8 00:42:22 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ruby.c (warn_cr_in_shebang): meaningless check on DOSISH platforms.
+ fixed a test failure introduced at r53998.
+
Tue Mar 8 00:27:53 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
* ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb: fix method name typo.
diff --git a/ruby.c b/ruby.c
index e77a862258..bbf2fdb762 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1668,6 +1668,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
return (VALUE)iseq;
}
+#ifndef DOSISH
static void
warn_cr_in_shebang(const char *str, long len)
{
@@ -1675,6 +1676,7 @@ warn_cr_in_shebang(const char *str, long len)
rb_warn("shebang line ends with \\r may cause a problem");
}
}
+#endif
struct load_file_arg {
VALUE parser;
@@ -1723,7 +1725,9 @@ load_file_internal(VALUE argp_v)
line_start++;
RSTRING_GETMEM(line, str, len);
if (len > 2 && str[0] == '#' && str[1] == '!') {
+#ifndef DOSISH
if (line_start == 1) warn_cr_in_shebang(str, len);
+#endif
if ((p = strstr(str+2, ruby_engine)) != 0) {
goto start_read;
}
@@ -1741,7 +1745,9 @@ load_file_internal(VALUE argp_v)
return 0;
RSTRING_GETMEM(line, str, len);
+#ifndef DOSISH
warn_cr_in_shebang(str, len);
+#endif
if ((p = strstr(str, ruby_engine)) == 0) {
/* not ruby script, assume -x flag */
goto search_shebang;
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 012deebae7..6ee151e5e8 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -314,7 +314,7 @@ class TestRubyOptions < Test::Unit::TestCase
assert_in_out_err([{'RUBYOPT' => nil}], "#!ruby -KU -Eutf-8\r\np \"\u3042\"\r\n",
["\"\u3042\""], /shebang line ends with \\r/,
- encoding: Encoding::UTF_8)
+ encoding: Encoding::UTF_8) if /mswin|mingw/ !~ RUBY_PLATFORM
bug4118 = '[ruby-dev:42680]'
assert_in_out_err(%w[], "#!/bin/sh\n""#!shebang\n""#!ruby\n""puts __LINE__\n",