aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix -e script encodingnobu2016-04-261-2/+19
| | | | | | | | * ruby.c (process_options): convert -e script to the encoding given by a command line option on Windows. assume it is the expected encoding. [ruby-dev:49461] [Bug #11900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r54742nobu2016-04-241-13/+3
| | | | | | Commit miss. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix compile error other than gccnobu2016-04-241-3/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fix command line encoding on cygwinnobu2016-04-231-0/+2
| | | | | | | * ruby.c: cygwin does not use w32_cmdvector, command line can be other than UTF-8. [ruby-dev:49519] [Bug #12184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove rb_thread_t::parse_in_evalnobu2016-03-281-31/+19
| | | | | | | | | | | | * parse.y (struct parser_params): move parse_in_eval flag from rb_thread_t. * parse.y (rb_parser_set_context): set parsing context, not only mild error flag. * iseq.c (rb_iseq_compile_with_option): the parser now refers no thread local states to be restored. * vm_eval.c (eval_string_with_cref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SyntaxError message at iseq compilenobu2016-03-191-0/+8
| | | | | | | | | | | | * iseq.c (rb_iseq_compile_with_option): make the parser in mild error. * load.c (rb_load_internal0): ditto. * parse.y (yycompile0): return the error message within the error to be raised. [Feature #11951] * parse.y (parser_compile_error): accumulate error messages in the error_buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: reduce fstatnobu2016-03-141-11/+4
| | | | | | | | | * file.c (ruby_is_fd_loadable): now return -1 if loadable but may block. * ruby.c (open_load_file): wait to read by the result of ruby_is_fd_loadable, without fstat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r54082 "ruby.c: load in binary mode"nobu2016-03-111-5/+2
| | | | | | | DATA is expected to be text mode, but there is no ways to make a FD to text mode from binary mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: load in binary modenobu2016-03-111-2/+5
| | | | | | | * ruby.c (open_load_file): always open in binary mode if provided, parser deals with CRs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: extra commanobu2016-03-081-20/+32
| | | | | | | * ruby.c (feature_option, debug_option, dump_option): remove an extra comma from option lists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rubyoptions.rb: fix testnobu2016-03-071-4/+2
| | | | | | | | * test/ruby/test_rubyoptions.rb (test_shebang): adjust only expected stderr as a warning, assertion has meaning on all platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (warn_cr_in_shebang): meaningless check on DOSISH platforms.usa2016-03-071-0/+6
| | | | | | | fixed a test failure introduced at r53998. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: warn_cr_in_shebangnobu2016-03-041-0/+10
| | | | | | | * ruby.c (load_file_internal): warn if shebang line ends with a carriage return. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: simplifynobu2016-03-041-9/+10
| | | | | | | * ruby.c (load_file_internal): simplify by local variables instead of repeating RSTRING macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: remove a magic numbernobu2016-03-041-1/+1
| | | | | | | | | | * 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
* parse without $.nobu2016-02-241-4/+1
| | | | | | | | | | | | * io.c (rb_io_gets_internal): read one line from an IO without setting ARGF.lineno. * parse.y (lex_io_gets): use rb_io_gets_internal not to affect $. global variable. * ruby.c (load_file): no longer reset $. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: remove unnecessary contextnobu2016-02-221-6/+2
| | | | | | | | * ruby.c (process_options): remove unnecessary context. rb_parser_append_print and rb_parser_while_loop just append some nodes and do not depend on the context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fixup r53791nobu2016-02-091-1/+0
| | | | | | | * ruby.c (DEFAULT_FEATURES): debug features are no longer set since r53791. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (dump_option): fix a typo.kazu2016-02-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: available list from enumnobu2016-02-091-2/+8
| | | | | | | * ruby.c (feature_option, debug_option, dump_option): build available list in warning messages from enum lists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: EACH_DUMPSnobu2016-02-091-18/+14
| | | | | | * ruby.c (EACH_DUMPS): define the list of dumping feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: set feature bits onlynobu2016-02-091-1/+3
| | | | | | | * ruby.c (DEFAULT_FEATURES): set feature bits only, excluding debug features. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: EACH_DEBUG_FEATURESnobu2016-02-091-3/+7
| | | | | | | * ruby.c (EACH_DEBUG_FEATURES): define the list of debug feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename ADD_FEATUREnobu2016-02-091-2/+3
| | | | | | | * ruby.c (ADD_FEATURE_NAME): rename ADD_FEATURE, as it does not add a feature, but just append a name to the message string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: err ambiguous feature name [ci skip]nobu2016-02-081-0/+22
| | | | | | | * ruby.c (feature_option): raise a runtime error if ambiguous feature name is given, in the future. [Bug #12050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: EACH_FEATURESnobu2016-02-071-8/+9
| | | | | | * ruby.c (EACH_FEATURES): define the list of feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: show feature namesnobu2016-02-071-0/+1
| | | | | | | * ruby.c (feature_option): show possible feature names when unknown argument is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.c: no exit in ruby_show_copyrightnobu2016-01-071-0/+1
| | | | | | | | | | * include/ruby/backward.h (ruby_show_copyright_to_die): for source code backward compatibility. * ruby.c (process_options): return Qtrue to exit the process successfully. * version.c (ruby_show_copyright): no longer exit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: overriding warning optionsnobu2015-12-291-2/+4
| | | | | | | * ruby.c (proc_options): successive -W option overrides previous warning options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: parse -W optionnobu2015-12-291-12/+14
| | | | | | | * ruby.c (proc_options): parse and skip '-W' option and its argument even if ignored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: command line option over RUBYOPT envnobu2015-12-291-2/+8
| | | | | | | * ruby.c (proc_options): -W command line option should be able to override -w in RUBYOPT environment variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.c: remove ruby_engine_namenobu2015-11-291-3/+3
| | | | | | | | | | | | | * ruby.c (load_file_internal, ruby_process_options): share ruby_engine instead of literal strings. * version.c (Init_version): remove internal `ruby_engine_name`, but set the VM program name in addition to the global constant. * vm_backtrace.c (location_to_str, oldbt_init): use th eVM program name always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.h: rename membernobu2015-11-251-7/+11
| | | | | | | | | | | * iseq.h (rb_compile_option_struct): rename the member frozen_string_literal_debug as debug_frozen_string_literal. [Feature #11725] * ruby.c (proc_options): do not set $DEBUG and $VERBOSE only if no arguments is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: --debug=frozen-string-literal optionnobu2015-11-211-7/+17
| | | | | | | * ruby.c (need_argument): move frozen-string-literal-debug option from --enable to --debug. [Feature #11725] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fix pointer overrunnobu2015-11-211-1/+1
| | | | | | | * ruby.c (proc_options): fix pointer overrun. do not advance argv until it is valid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fix ARGV doc [ci skip]nobu2015-11-191-2/+1
| | | | | | | * ruby.c (ruby_prog_init): [DOC] ARGV does not contain the name of the executable. [ruby-core:71561] [Bug #11711] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: feature_optionnobu2015-11-191-20/+21
| | | | | | | * ruby.c (feature_option): unify enable_option and disable_option not to repeat feature names twice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: set compile options at oncenobu2015-11-191-13/+24
| | | | | | | * ruby.c (process_options): set instruction compilation options at once, and set disabled options to false explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c: introduce --enable-frozen-string-literal-debug option.ko12015-10-231-0/+9
| | | | | | | | | | | | | | | | | | | | | If this option is enabled, the modify error will be: can't modify frozen String (RuntimeError) => can't modify frozen String, created at test.rb:3 (RuntimeError) * iseq.h: add compile option frozen_string_literal_debug. * compile.c: catch up this fix. * error.c (rb_error_frozen): ditto. * iseq.c (set_compile_option_from_hash): ditto. * test/ruby/test_rubyoptions.rb: add a test for this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: disable nonblock only if nonblocking modenobu2015-10-181-4/+6
| | | | | | | * ruby.c (open_load_file): disable O_NONBLOCK only when opened in non-blocking mode, to get rid of LoadError on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (open_load_file): add a comment.kosaki2015-10-181-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ChangeLog: Good-bye OS/2.kosaki2015-10-181-2/+0
| | | | | | | | | | | | | | | | | | | | * common.mk: ditto. * configure.in: ditto. * dln_find.c: ditto. * ext/Setup.emx: ditto. * ext/extmk.rb: ditto. * ext/socket/extconf.rb: ditto. * ext/zlib/extconf.rb: ditto. * file.c: ditto. * include/ruby/defines.h: ditto. * io.c: ditto. * lib/mkmf.rb: ditto. * missing/os2.c: ditto. * process.c: ditto. * ruby.c: ditto. * NEWS: announce OS/2 is no longer supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (open_load_file): use rb_thread_wait_fd() instead of reopen.kosaki2015-10-181-19/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: unnecessary variablenobu2015-10-171-1/+1
| | | | | | | * ruby.c (open_load_file): remove unnecessary nested local variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: set errnonobu2015-10-171-1/+2
| | | | | | * file.c (ruby_is_fd_loadable): set proper errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: suppress warningsnobu2015-10-171-4/+6
| | | | | | | | * ruby.c (loadopen_func): suppress a warning, unused function. * ruby.c (open_load_file): suppress warnings, results of close(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (open_load_file): reset O_NONBLOCK after open.kosaki2015-10-171-9/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | Even if S_ISREG() is true, the file may be file on FUSE filesystem or something. We can't assume O_NONBLOCK is safe. Moreover, we should wait if the path is point to FIFO. That's FIFO semantics. GVL should be transparent from ruby script. Thus, just reopen without O_NONBLOCK for filling the requirements. [Bug #11060][Bug #11559] * ruby.c (loadopen_func): new for the above. * file.c (ruby_is_fd_loadable): new. for checks loadable file type of not. * file.c (rb_file_load_ok): use ruby_is_fd_loadble() * internal.h: add ruby_is_fd_loadble() * common.mk: now, ruby.o depend on thread.h. * test/ruby/test_require.rb (TestRequire#test_loading_fifo_threading_success): new test. This test successful case that loading from FIFO. * test/ruby/test_require.rb (TestRequire#test_loading_fifo_threading_raise): rename from test_loading_fifo_threading. You souldn't rescue an exception if you test raise or not. Moreover, this case should be caught IOError because load(FIFO) should be blocked until given any input. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: unify nested codenobu2015-10-171-29/+21
| | | | | | | | * ruby.c (load_file): unify each preparations and clean-ups by merging load_file_internal and load_file_internal2, and remove nested rb_protect and rb_ensure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: conflicting O_NONBLOCKnobu2015-10-171-2/+6
| | | | | | | * ruby.c (load_file_internal): do not use O_NONBLOCK when conflicting with O_ACCMODE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fd leaknobu2015-10-161-5/+5
| | | | | | * ruby.c (load_file_internal): fix potential fd leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e