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

227 Коммитов

Автор SHA1 Сообщение Дата
nobu 9fb521515d * vm_core.h (struct rb_vm_struct): moved src_encoding_index.
* ruby.c (struct cmdline_options): moved setids and req_list, and the
  latter is now an array, to prevent memory leak.

* ruby.c (cmdline_options_init): added.

* ruby.c (add_modules, require_libraries, init_ids, forbid_setid): use
  struct cmdline_options.

* vm.c (vm_init2): initialize src_encoding_index.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 04:20:07 +00:00
ko1 72ba13aa8e * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c,
  io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c,
  string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c,
  vm.c, gc.c:
  allocated memory objects by xmalloc (ruby_xmalloc) should be
  freed by xfree (ruby_xfree).
* ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c,
  ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c,
  ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c,
  ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c,
  ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c:
  ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 10:01:40 +00:00
nobu 8f05f7fe05 * ruby.c (set_arg0): reverted used variable definition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 18:52:15 +00:00
naruse ccb61351ea * rational.c (string_to_r_internal): use rb_isdigit.
* marshal.c (long_toobig): use %zd.

* ruby.c (set_arg0): move unused variable definition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 18:23:10 +00:00
nobu 075530a685 * suppress warnings with -Wwrite-string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
nobu 75aa81b79d * ruby.c (process_options): --dump option exit immediately.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20 04:19:27 +00:00
nobu 8afd39ad09 * ruby.c (proc_options, process_options): --dump option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20 03:13:52 +00:00
nobu 294a1d2270 * ruby.c (ruby_init_gems), gem_prelude.rb: check if Gem is defined
instead of Gem::Enable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 01:52:53 +00:00
nobu 4264ca9436 * dln.c (dln_find_exe_r, dln_find_file_r): reentrant versions.
* file.c (rb_find_file_ext, rb_find_file), process.c (proc_exec_v),
  (rb_proc_exec, proc_spawn_v, proc_spawn), ruby.c (process_options):
  use reentrant versions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07 21:43:54 +00:00
usa ffd4bf96cc * ruby.c (process_options, ruby_set_argv): set encoding of rb_argv
after Init_prelude() because cannot load encoding extensions before
	  it.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07 11:25:23 +00:00
nobu 01b773a093 * load.c (rb_load_path), vm_core.h (rb_vm_t): moved to VM.
* load.c (rb_get_load_path): returns absolute load path.

* load.c (load_path_getter): $LOAD_PATH getter.

* file.c (rb_find_file_ext, rb_find_file), ruby.c (push_include,
  ruby_init_loadpath): use the accessor.

* vm.c (rb_vm_mark): mark load_path.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-30 09:03:03 +00:00
naruse fe0446cc01 * ruby.c (ruby_set_argv): ARGV should be locale encoding.
[ruby-list:44861]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 23:08:38 +00:00
matz ae6782315a * ruby.c (process_options): set safe_level before loading script.
[ruby-dev:34421]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-24 08:20:56 +00:00
nobu 6cdd421a9b * ruby.c (process_options): preludes and parser need to run in safe
level 0.  [ruby-dev:34407]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 17:40:46 +00:00
nobu 73437c05f5 * ruby.c (process_options): dln_find_file returns the pointer to a
static buffer, so should copy it.  [ruby-dev:34409]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 17:26:29 +00:00
nobu 639c3a8962 * include/ruby/intern.h (rb_argv): replaced with rb_get_argv().
[ruby-Bugs-19514]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 09:02:19 +00:00
nobu 7b4a171158 * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.

* gc.c (source_filenames): removed.

* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
  ripper_initialize): rb_source_filename() is no longer used.

* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
  parser_warn, e_option_supplied, warn_unless_e_option, range_op,
  cond0): nd_file is no longer used.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 03:41:51 +00:00
nobu f6001be537 * ruby.c (proc_options): checks if the word is empty.
* ruby.c (process_options): typo fixed.  [ruby-dev:34122]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-25 07:32:58 +00:00
matz 8149168db6 * ruby.c (usage): remove some unimportant lines to fit -h message
in a page.  [ruby-dev:34018]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-10 15:47:47 +00:00
nobu 6a9bfa23bf * ruby.c (load_file): parse shebang in us-ascii. a patch from
sheepman <sheepman AT sheepman.sakura.ne.jp> in [ruby-dev:33955]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-02 01:13:15 +00:00
nobu b8a733d0b8 * io.c (struct argf): packed ARGF stuffs.
* ruby.c (proc_options): use ruby_set_inplace_mode().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 08:59:04 +00:00
nobu b676e2671e * ruby.c (enable_option, disable_option): allow all for all known
features.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23 21:49:15 +00:00
nobu 552badf29f * debug.c (ruby_set_debug_option): separated ruby_each_words().
* util.c (ruby_each_words): extracted from ruby_set_debug_option().

* ruby.c (proc_options): generalized enable/disable options.

* ruby.c (ruby_init_gems): take enabled flag.  [ruby-core:14840]

* ruby.c (process_options): added --disable-rubyopt flag.

* include/ruby/util.h (ruby_each_words): prototype.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23 21:13:05 +00:00
nobu b3b3ff29b5 * ruby.c (proc_options): check if argument for -E exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23 20:25:29 +00:00
naruse 9a431fd58c * ruby.c (process_options): set default_external before loading
libraries. [ruby-dev:33801]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 23:03:22 +00:00
naruse dd738cd887 * ruby.c (load_file): enc must effect source encoding.
[ruby-core#15496]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 01:20:43 +00:00
naruse bd5a15f76d * ruby.c (load_file): the encoding of DATA follows the source
file encoding. [ruby-dev:33693]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-11 01:47:26 +00:00
usa 2160c40fb2 * parse.y (parser_initialize): set default script encoding as US-ASCII.
* ruby.c (load_file): ditto.

	* ruby.c (process_options): set script encoding of -e from locale
	  except when -K is specified.

	* ruby.c (load_file): set script encoding of stdin from locale except
	  when -K is specified. [ruby-dev:33375]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 18:49:28 +00:00
nobu a984e00b80 * ruby.c (load_file): set default to ASCII-8BIT explicitly if -K
option is not given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 08:12:15 +00:00
nobu 8020c2e676 * ruby.c (process_options, load_file, rb_load_file): propagates script
encoding by -K to libraries.  [ruby-dev:33156]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 07:11:18 +00:00
nobu 5776f23d69 * ruby.c (process_options): set encoding of -e option from -E option
if they are compatible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 06:56:50 +00:00
nobu c30d2489dd * ruby.c (cmdline_arguments): split argc and argv from cmdline_options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 06:41:22 +00:00
nobu 95e59bd9e0 * ruby.c (process_options): not set encoding of -e option from -E
option if they are not compatible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 06:12:44 +00:00
usa 2fc0fe5332 * ruby.c (proc_options, process_options, load_file): shouldn't effect
--encoding to script encoding. [ruby-dev:33169]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25 04:18:14 +00:00
naruse ac7794478c * ruby.c (proc_optionc): -Kn means ASCII-8BIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23 16:08:04 +00:00
nobu 9872d4d600 * parse.y (parser_prepare): get encoding from the first line.
[ruby-dev:33168]

* ruby.c (load_file): set encoding to input with set_encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-18 23:35:38 +00:00
nobu 9eab65b3f0 * ruby.c (proc_options): encoding libraries cannot be loaded until
load path is set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-15 07:59:33 +00:00
matz c884219d96 * ruby.1: a patch to describe --encoding. a patch from Yugui
<yugui AT yugui.sakura.ne.jp> in [ruby-dev:33079].

* ruby.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14 07:10:22 +00:00
nobu e26e05c4ab * ruby.c (load_file): local variable was not initialized when -x flag
is given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13 04:53:02 +00:00
nobu 60e38b6efb * ruby.c (load_file): script files should not be affected by locale.
[ruby-dev:33054]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13 04:50:48 +00:00
nobu a7b36aebe8 * ruby.c (proc_options): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13 04:37:17 +00:00
naruse 513d0ca7f6 * encoding.c (ENCINDEX_EUC_JP, ENCINDEX_SJIS): removed.
(rb_enc_init): EUC-JP and Shift_JIS are not builtin now.

* enc/Makefile.in: ditto.

* common.mk: ditto.

* ruby.c (proc_options): ditto.

* enc/shift_jis.c, enc/euc_jp.c: fixes for romove from builtin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13 02:51:15 +00:00
naruse 7f9c3b1c97 * ruby.c (process_options): -e'script' is locale encoding by default.
(load_file): ruby script from stdin is locale encoding by default.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-11 19:41:22 +00:00
nobu d036633dcb * ruby.c (process_options): give priority command line encoding option
to RUBYOPT, and enable -E option in RUBYOPT.

* ruby.c (load_file): deal with encoding option in shebang line if
  nothing in command line and RUBYOPT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-09 06:54:26 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
nobu 4be0eb95cf * ruby.c (proc_options): no need for intermediate object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05 04:04:26 +00:00
matz b65d6208fe * ruby.c (proc_options): update according to the last API revert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04 16:47:41 +00:00
akr 041e829127 * include/ruby/encoding.h (rb_isascii): defined.
(rb_isalnum): ditto.
  (rb_isalpha): ditto.
  (rb_isblank): ditto.
  (rb_iscntrl): ditto.
  (rb_isdigit): ditto.
  (rb_isgraph): ditto.
  (rb_islower): ditto.
  (rb_isprint): ditto.
  (rb_ispunct): ditto.
  (rb_isspace): ditto.
  (rb_isupper): ditto.
  (rb_isxdigit): ditto.
  (rb_tolower): ditto.
  (rb_toupper): ditto.

* include/ruby/st.h (st_strcasecmp): declared.
  (st_strncasecmp): ditto.

* st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp.
  (st_strcasecmp): defined.
  (st_strncasecmp): ditto.

* include/ruby/ruby.h: include include/ruby/encoding.h.
  (ISASCII): use rb_isascii.
  (ISPRINT): use rb_isprint.
  (ISSPACE): use rb_isspace.
  (ISUPPER): use rb_isupper.
  (ISLOWER): use rb_islower.
  (ISALNUM): use rb_isalnum.
  (ISALPHA): use rb_isalpha.
  (ISDIGIT): use rb_isdigit.
  (ISXDIGIT): use rb_isxdigit.
  (TOUPPER): defined.
  (TOLOWER): ditto.
  (STRCASECMP): ditto.
  (STRNCASECMP): ditto.

* dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c,
  transcode.c, ext/readline/readline.c: use locale insensitive
  functions.  [ruby-core:14662]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-01 12:24:04 +00:00
nobu d64a975396 * ruby.c (process_options): rejects dummy encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-31 16:04:11 +00:00
nobu 6cb161a66c * ruby.c (proc_options, process_options): delays finding encoding
until load_path is set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-31 14:57:46 +00:00