Граф коммитов

526 Коммитов

Автор SHA1 Сообщение Дата
nobu d9b9423ba8 ruby.c: encode script name
* ruby.c (process_options): encode script name to locale encoding
  instead of associate, if UTF-8 path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17 04:47:05 +00:00
nobu c7c1f371a4 ruby.c: defining DATA
* ruby.c (load_file_internal): define DATA here instead of ensure
  func.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31 12:55:00 +00:00
nobu 3408e3b460 ruby.c: forbid options
* ruby.c (forbid_setid): constified.

* ruby.c (process_options): forbid if setid earlier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31 12:54:59 +00:00
usa 42d9712e78 declare `rb_w32_sysinit` in header.
* include/ruby/win32.h (rb_w32_sysinit): declare.
  [ruby-core:78444] [Bug #12994]

* ruby.c (ruby_sysinit): follow above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-13 05:17:48 +00:00
nobu 1db7b0ad7c ruby.c: dump option
* ruby.c (process_options): dump specified informations all, not
  only first one.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-07 14:39:24 +00:00
nobu 4791b2bc22 ruby.c: retry loading with GC
* ruby.c (open_load_file): retry after GC when the limit for open
  file descriptors reached.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-21 07:06:27 +00:00
usa e592a735cb * ruby.c (open_load_file): revert r56385. it introduced incompatibility
about `DATA.binmode?`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-12 12:07:16 +00:00
nobu 21f1b89b9d ruby.c: fix macros
* ruby.c (open_load_file): FILE_ALT_SEPARATOR and EXEEXT are
  config.status variables, not available in config.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-12 08:24:36 +00:00
nobu 8c3af8ecc0 ruby.c: bind fd before waiting
* ruby.c (open_load_file): bind the open fd to an IO instance
  before waiting FIFO, not to leak the fd if interrupted.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-10 06:22:30 +00:00
nobu 3ef1149bbe ruby.c: compare with EXEEXT
* ruby.c (open_load_file): compare with EXEEXT instead of hard
  coded name, and do not match with mere EXEEXT.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-10 03:40:56 +00:00
nobu 18d0bf952a ruby.c: open in binary mode to load
* ruby.c (open_load_file): open in binary mode if available, as
  parser deals with EOLs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-10 03:40:06 +00:00
nobu ea293952c5 ruby_cmdline_options_t
* ruby.c (ruby_cmdline_options_t): typedef.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-19 10:44:53 +00:00
nobu c463366dfd rb_funcallv
* *.c: rename rb_funcall2 to rb_funcallv, except for extensions
  which are/will be/may be gems.  [Fix GH-1406]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-29 11:57:14 +00:00
ko1 9f60791a04 * vm_core.h: revisit the structure of frame, block and env.
[Bug #12628]

  This patch introduce many changes.

  * Introduce concept of "Block Handler (BH)" to represent
    passed blocks.

  * move rb_control_frame_t::flag to ep[0] (as a special local
    variable). This flags represents not only frame type, but also
    env flags such as escaped.

  * rename `rb_block_t` to `struct rb_block`.

  * Make Proc, Binding and RubyVM::Env objects wb-protected.

  Check [Bug #12628] for more details.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-28 11:02:30 +00:00
nobu 02687cd74f ruby.c: refix r55260
* ruby.c (process_options): rb_str_conv_enc() never set encoding
  of the source string, but returns the string itself if the
  conversion failed.  then the instance variable does not need to
  be set again.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-03 12:27:24 +00:00
usa 8f86f5d691 * ruby.c (process_options): need to duplicate path before passing it to
rb_str_conv_enc() because the function might call rb_enc_associate()
  internally.  this fixes test failures on Windows introduced at r55260.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-03 09:06:19 +00:00
nobu 360f742564 ruby.c: no MAXPATHLEN for loadpath
* ruby.c (ruby_init_loadpath_safe): remove MAXPATHLEN restriction
  for Windows 10.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-02 08:05:21 +00:00
nobu 6ef87aa633 Fix -e script encoding
* 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
2016-04-26 14:35:24 +00:00
nobu 3184407aef Revert r54742
Commit miss.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-24 03:42:25 +00:00
nobu 33b523db5e Fix compile error other than gcc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-24 02:56:20 +00:00
nobu 88783116e0 ruby.c: fix command line encoding on cygwin
* 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
2016-04-23 00:03:37 +00:00
nobu d7935475fc remove rb_thread_t::parse_in_eval
* 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
2016-03-28 21:39:24 +00:00
nobu bc343b851d SyntaxError message at iseq compile
* 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
2016-03-19 05:46:20 +00:00
nobu a4e6f7d707 ruby.c: reduce fstat
* 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
2016-03-14 07:03:01 +00:00
nobu a2b88f5325 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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-11 03:30:25 +00:00
nobu d661eb44c7 ruby.c: load in binary mode
* 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
2016-03-11 01:47:19 +00:00
nobu 7b7c7b339c ruby.c: extra comma
* 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
2016-03-08 15:21:22 +00:00
nobu b8f987b36c test_rubyoptions.rb: fix test
* 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
2016-03-07 19:39:32 +00:00
usa e89d48a1e6 * 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
2016-03-07 15:44:34 +00:00
nobu 6b327e72c3 ruby.c: warn_cr_in_shebang
* 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
2016-03-04 13:27:36 +00:00
nobu 989a6f1ce8 ruby.c: simplify
* 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
2016-03-04 05:19:12 +00:00
nobu df091c5cb9 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
2016-03-04 03:53:43 +00:00
nobu d4819da611 parse without $.
* 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
2016-02-24 08:21:04 +00:00
nobu b0d81c1073 ruby.c: remove unnecessary context
* 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
2016-02-22 14:54:31 +00:00
nobu 70a4e9e7c8 ruby.c: fixup r53791
* 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
2016-02-09 10:18:50 +00:00
kazu add54214c7 * ruby.c (dump_option): fix a typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-09 08:55:18 +00:00
nobu 67d1018982 ruby.c: available list from enum
* 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
2016-02-09 08:32:20 +00:00
nobu 80e9ca6013 ruby.c: EACH_DUMPS
* 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
2016-02-09 08:24:37 +00:00
nobu b6dcc3963a ruby.c: set feature bits only
* 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
2016-02-09 07:42:21 +00:00
nobu ade0d8e26e ruby.c: EACH_DEBUG_FEATURES
* 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
2016-02-09 07:36:27 +00:00
nobu 4859eba88f rename ADD_FEATURE
* 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
2016-02-09 05:47:12 +00:00
nobu 12bdb15e71 ruby.c: err ambiguous feature name [ci skip]
* 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
2016-02-08 01:30:22 +00:00
nobu 2c9274eff2 ruby.c: EACH_FEATURES
* 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
2016-02-07 10:21:27 +00:00
nobu 3890bb60a9 ruby.c: show feature names
* 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
2016-02-07 02:40:52 +00:00
nobu 7aab062ef3 version.c: no exit in ruby_show_copyright
* 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
2016-01-07 02:34:33 +00:00
nobu 290deeb705 ruby.c: overriding warning options
* 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
2015-12-29 12:23:04 +00:00
nobu 1eafb3dd4b ruby.c: parse -W option
* 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
2015-12-29 10:39:53 +00:00
nobu 66fe2c0dd9 ruby.c: command line option over RUBYOPT env
* 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
2015-12-29 10:12:48 +00:00
nobu fc0c2d1cc2 version.c: remove ruby_engine_name
* 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
2015-11-29 02:25:12 +00:00
nobu 012368007f iseq.h: rename member
* 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
2015-11-25 08:02:29 +00:00