aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-04 03:53:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-04 03:53:43 +0000
commit366b0d0c34c1bfb213ba55fcf405968c19c6ccea (patch)
tree193cb19cc2092800c0015d088f3368518d38c6f1 /ruby.c
parente373d99f356779c1823c81603eaee6ed71cf68f5 (diff)
downloadruby-366b0d0c34c1bfb213ba55fcf405968c19c6ccea.tar.gz
ruby.c: remove a magic number
* ruby.c (load_file_internal): remove a magic number, which means the length of ruby_engine but the value is unknown in this file since the variable is in a different file now. instead, strstr should deal with it well, as far as ruby_engine does not contain a space and a hyphen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 9bc2aa78fa..95d8c8459e 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1737,10 +1737,10 @@ load_file_internal(VALUE argp_v)
}
start_read:
- p += 4;
RSTRING_PTR(line)[RSTRING_LEN(line) - 1] = '\0';
if (RSTRING_PTR(line)[RSTRING_LEN(line) - 2] == '\r')
RSTRING_PTR(line)[RSTRING_LEN(line) - 2] = '\0';
+ /* ruby_engine should not contain a space */
if ((p = strstr(p, " -")) != 0) {
opt->warning = 0;
moreswitches(p + 1, opt, 0);