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

154 Коммитов

Автор SHA1 Сообщение Дата
matz 2031602787 * signal.c (trap): remove sigexit(); handle "EXIT" via sig_exec().
[ruby-dev:26440]

* io.c (rb_io_inspect): replace sprintf() with "%s" format all
  over the place by snprintf() to avoid integer overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-19 08:31:04 +00:00
ocean 7a986b2871 * hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-13 04:04:33 +00:00
matz 8db3dc39d6 * signal.c (sigexit): call rb_thread_signal_exit() instead of
rb_exit().  [ruby-dev:26347]

* eval.c (rb_thread_signal_exit): a new function to exit on main
  thread.

* eval.c (rb_thread_switch): exit status should be retrieved from
  ruby_errinfo.

* eval.c (rb_f_exit): ensure exit(0) should call
  exit(EXIT_SUCCESS).

* missing/mkdir.c: remove. [ruby-core:05177]

* hash.c (env_aset): do not treat nil as key-removing value.
  [ruby-list:40865]

* parse.y (method_call): allow aref expression ([]) to take a
  block.

* parse.y (block_dup_check): a function to check duplication of
  a block argument and an actual block.

* lib/delegate.rb (SimpleDelegator::__setobj__): need check for
  recursive delegation.  [ruby-core:04940]

* lib/cgi.rb: add underscore aliases CGI::escape_html,
  CGI::unescape_html, CGI::escape_element, CGI::unescape_element.
  [ruby-core:05058]

* misc/ruby-mode.el (ruby-expr-beg): fix looking point drift.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-12 16:56:06 +00:00
ocean 8f1f1183f5 * hash.c (Init_Hash): remove custom "hash" and "eql?".
(ported from 1.8) [ruby-dev:26132]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-08 12:23:51 +00:00
nobu 98c50b0b93 * hash.c:rb_hash_hash_i() should be static. [ruby-core:04815]
* re.c should include regint.h for declarations of oniguruma
  functions.  [ruby-core:04815]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-05 23:08:47 +00:00
ocean 373282f665 * hash.c (env_key): ENV.index is deprecated as well as Hash#index.
use ENV.key instead. [ruby-dev:25974]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-02 04:23:56 +00:00
matz 70bbad3cfd * array.c: replace rb_protect_inspect() and rb_inspecting_p() by
rb_exec_recursive() in eval.c.

* eval.c (rb_exec_recursive): new function.

* array.c (rb_ary_join): use rb_exec_recursive().

* array.c (rb_ary_inspect, rb_ary_hash): ditto.

* file.c (rb_file_join): ditto.

* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.

* io.c (rb_io_puts): ditto.

* object.c (rb_obj_inspect): ditto

* struct.c (rb_struct_inspect): ditto.

* lib/set.rb (SortedSet::setup): a hack to shut up warning.
  [ruby-talk:132866]

* lib/time.rb (Time::strptime): add new function.  inspired by
  [ruby-talk:132815].

* lib/parsedate.rb (ParseDate::strptime): ditto.

* regparse.c: move st_*_strend() functions from st.c.  fixed some
  potential memory leaks.

* exception error messages updated.  [ruby-core:04497]

* ext/socket/socket.c (Init_socket): add bunch of Socket
  constants.  Patch from Sam Roberts <sroberts@uniserve.com>.
  [ruby-core:04409]

* array.c (rb_ary_s_create): no need for negative argc check.
  [ruby-core:04463]

* array.c (rb_ary_unshift_m): ditto.

* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
  of StandardError class, not Exception class.  [ruby-core:04429]

* parse.y (fcall_gen): lvar(arg) will be evaluated as
  lvar.call(arg) when lvar is a defined local variable. [new]

* object.c (rb_class_initialize): call inherited method before
  calling initializing block.

* eval.c (rb_thread_start_1): initialize newly pushed frame.

* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
  fixed: [ruby-core:04444]

* eval.c (is_defined): NODE_IASGN is an assignment.

* ext/readline/readline.c (Readline.readline): use rl_outstream
  and rl_instream.  [ruby-dev:25699]

* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
  [ruby-dev:25675]

* misc/ruby-mode.el: [ruby-core:04415]

* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]

* lib/rdoc/generators/ri_generator.rb: ditto.

* struct.c (make_struct): fixed: [ruby-core:04402]

* ext/curses/curses.c (window_color_set): [ruby-core:04393]

* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
  [ruby-talk:130092]

* object.c: [ruby-doc:818]

* parse.y (open_args): fix too verbose warnings for the space
  before argument parentheses.  [ruby-dev:25492]

* parse.y (parser_yylex): ditto.

* parse.y (parser_yylex): the first expression in the parentheses
  should not be a command.  [ruby-dev:25492]

* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]

* object.c (Init_Object): remove Object#type.  [ruby-core:04335]

* st.c (st_foreach): report success/failure by return value.
  [ruby-Bugs-1396]

* parse.y: forgot to initialize parser struct.  [ruby-dev:25492]

* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
  [ruby-talk:127711]

* document updates - [ruby-core:04296], [ruby-core:04301],
  [ruby-core:04302], [ruby-core:04307]

* dir.c (rb_push_glob): should work for NUL delimited patterns.

* dir.c (rb_glob2): should aware of offset in the pattern.

* string.c (rb_str_new4): should propagate taintedness.

* env.h: rename member names in struct FRAME; last_func -> callee,
  orig_func -> this_func, last_class -> this_class.

* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* object.c (Init_Object): remove rb_obj_id_obsolete()

* eval.c (rb_mod_define_method): incomplete subclass check.
  [ruby-dev:25464]

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]

* bignum.c (rb_big_rand): should return positive random number.
  [ruby-dev:25401]

* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
  random bignums.  [ruby-dev:25396]

* variable.c (rb_autoload): [ruby-dev:25373]

* eval.c (svalue_to_avalue): [ruby-dev:25366]

* string.c (rb_str_justify): [ruby-dev:25367]

* io.c (rb_f_select): [ruby-dev:25312]

* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]

* struct.c (make_struct): [ruby-dev:25249]

* dir.c (dir_open_dir): new function.  [ruby-dev:25242]

* io.c (rb_f_open): add type check for return value from to_open.

* lib/pstore.rb (PStore#transaction): Use the empty content when a
  file is not found.  [ruby-dev:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 06:47:45 +00:00
ksaito a19d6b33d7 * ascii.c, euc_jp.c, hash.c, oniggnu.h, oniguruma.h, regcomp.c, regenc.c, regenc.h, regerror.c, regexec.c, reggnu.c, regint.h, regparse.c, regparse.h, sjis.c, st.c, st.h, utf8.c: imported Oni Guruma 3.5.4.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-28 15:21:48 +00:00
matz aa92750f27 * process.c (proc_setgroups): [ruby-dev:25081]
* re.c (rb_reg_eqq): document fix.  [ruby-talk:122541]

* io.c (io_fread): take VALUE argument.

* ext/socket/socket.c (sock_connect): use rb_str_new4().
  [ruby-dev:25052]

* eval.c (rb_yield_0): [ruby-dev:25051]

* io.c (io_write): remove rb_str_locktmp().  [ruby-dev:25050]

* io.c (io_fwrite): takes VALUE string as an argument.
  [ruby-dev:25050]

* ext/socket/socket.c (sock_connect): remove rb_str_locktmp().
  [ruby-dev:25050]

* ext/socket/socket.c (udp_connect): [ruby-dev:25045]

* ext/socket/socket.c (udp_bind): ditto.

* ext/socket/socket.c (udp_send): ditto.

* ext/socket/socket.c (bsock_send): ditto.

* ext/socket/socket.c (s_recvfrom): ditto.

* hash.c (rb_hash_hash): should provide "hash" method where "eql?"
  is redefined.  [ruby-talk:122482]

* ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 15:31:26 +00:00
matz 5141d3ea79 * hash.c (rb_f_getenv): prohibit for $SAFE=4. [ruby-dev:24908]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-18 08:11:12 +00:00
matz 02f848f9a4 * numeric.c (flo_divmod): protect float values from GC by
assignment to local variables.  [ruby-dev:24873]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-16 14:51:38 +00:00
nobu 3f075b9ac9 rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-20 01:38:04 +00:00
matz fbb88b011a * io.c (rb_io_mode_flags): preserve append mode flag.
[ruby-dev:24436]

* io.c (rb_io_modenum_mode): do not use external output buffer.

* string.c (rb_str_justify): differ pointer retrieval to prevent
  padding string modification.  [ruby-dev:24434]

* range.c (range_each_func): allow func to terminate loop by
  returning RANGE_EACH_BREAK.

* range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-06 07:40:06 +00:00
matz 30116ff8c2 * array.c (rb_ary_delete): comparison may change the capacity.
[ruby-dev:24348]

* array.c (rb_ary_fill): fill should honor length argument.
  [ruby-dev:24346]

* array.c (rb_ary_replace): should not use ptr from shared array.
  [ruby-dev:24345]

* ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
  [ruby-talk:113807]

* array.c (flatten): element size might change during comparison.
  [ruby-dev:24343]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-29 05:15:33 +00:00
nobu 7e827e6694 * hash.c: iterator functions for hash_foreach() should return enum
st_retval.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-24 19:05:07 +00:00
matz f1f0f39e03 * hash.c (rb_hash_rehash): replace st_foreach() by its deep
checking counterpart.  [ruby-dev:24310]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-23 00:51:32 +00:00
matz 61d1dce5a2 * hash.c (hash_alloc): was using tbl pointer without
initialization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22 04:52:17 +00:00
matz 0c97c8e335 * hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]
* st.c (st_foreach): add deep check.

* hash.c (rb_hash_fetch): returns KeyError instead of IndexError.

* hash.c (env_fetch): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22 04:48:52 +00:00
matz 136b284b59 * parse.y: remove global variables ruby_eval_tree and
ruby_eval_tree_begin.

* array.c (rb_ary_collect_bang): element size might change during
  comparison.  [ruby-dev:24300]

* array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300]

* array.c (rb_ary_eql): ditto. [ruby-dev:24300]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22 00:19:15 +00:00
matz bfabc05a43 * enum.c (enum_sort_by): do not use qsort directly. use
rb_ary_sort_bang() instead.  [ruby-dev:24291]

* enum.c (enum_sort_by): pedantic type check added.
  [ruby-dev:24291]

* hash.c (rb_hash_foreach_iter): check iter_lev after each
  iteration.  [ruby-dev:24289]

* array.c (rb_ary_and): element size might change during
  comparison.  [ruby-dev:24290]

* array.c (rb_ary_or): ditto. [ruby-dev:24292]

* array.c (rb_ary_equal): wrong fix. [ruby-dev:24286]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-21 03:08:33 +00:00
matz 21606c6ec5 * array.c: remove #indexes, #indices.
* hash.c: ditto.

* ext/dbm/dbm.c: remove #indexes, #indices, "values_at" warning
  from #select.

* ext/gdbm/gdbm.c: ditto.

* ext/sdbm/init.c: ditto.

* ext/dbm/dbm.c (Init_dbm): set VERSION constant as "unknown" when
  DB_VERSION_STRING is not available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-11 13:33:47 +00:00
matz 1b0f90ca33 * parse.y (string_content): turn off NODE_NEWLINE flag to avoid
unnecessary line trace for inlined expression.
  (ruby-bugs PR#1320)

* numeric.c (flo_to_s): tweak output string based to preserve
  decimal point and to remove trailing zeros.  [ruby-talk:97891]

* string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
  search.  [ruby-talk:97342]

* hash.c (rb_hash_equal): returns true if two hashes have same set
  of key-value set.  [ruby-talk:97559]

* hash.c (rb_hash_eql): returns true if two hashes are equal and
  have same default values.

* string.c (rb_str_equal): always returns true or false, never
  returns nil. [ruby-dev:23404]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-07 08:44:24 +00:00
matz 4ded52b623 * file.c (rb_get_path): get path string via "to_path" method if
path object is not a string. [Ruby2]

* gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
  exit finalizers.

* io.c (rb_io_reopen): should use rb_io_check_io().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 02:51:05 +00:00
matz 919f456de8 * exception message clean-up by Ian Macdonald <ian@caliban.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-29 07:54:38 +00:00
matz aba4666e19 * eval.c (localjump_destination): lambda should not interfere
return from the yielded block.

* hash.c (delete_if_i): use st_delete_safe() (via
  rb_hash_delete()) instead of returning ST_DELETE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-26 17:15:00 +00:00
dave a3ecd5c83d RDoc comments for Fixnum, Float, and Hash. Add heuristic to RDoc to handle yaml/stringio
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23 16:21:17 +00:00
matz 1c09bfad5c * eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead of
ALLOW_INTS which may switch context.  [ruby-dev:22319]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-22 09:37:13 +00:00
matz 6228cbe5ef dln.c: remove last second typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-20 16:59:09 +00:00
matz e6f473c3a0 * misc/ruby-mode.el (ruby-calculate-indent): proper indentation
inside of parentheses.  [ruby-dev:22308]

* hash.c (delete_if_i): do not use ST_DELETE for thread safety.
  [ruby-dev:21899]  (not fully solved)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-19 17:29:09 +00:00
nobu f284f6a41b * hash.c (env_has_value, env_index): must match exactly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28 10:28:21 +00:00
usa 2a9719235d * defines.h (ENV_IGNORECASE): should define when DOSISH without
human68k.

* hash.c (env_has_value, env_index): don't ignore case of value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-25 12:44:26 +00:00
matz 9e1709139d * hash.c: remove unnecessary update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-15 00:03:01 +00:00
matz ba2147ba40 * eval.c (rb_method_node): new API to retrieve method body.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-14 23:54:06 +00:00
matz 818d6a1e4f * eval.c (rb_load): allow interrupt during loaded program
evaluation.  [ruby-dev:21834]

* hash.c (rb_hash_fetch): always warn if default argument and a
  block are supplied at the same time. [ruby-dev:21842]

* hash.c (env_fetch): ditto.

* array.c (rb_ary_fetch): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-06 07:22:39 +00:00
eban da191c4547 * class.c, hash.c, string.c: remove #include "version.h".
* Makefile.in: remove needless version.h dependency.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-04 14:40:30 +00:00
matz a4934a42cb * io.c (read_all): fptr->f may be NULL, if IO is closed in the
signal handler.

* io.c (io_read): ditto.

* string.c (get_pat): remove 1.8.0 warning code.

* string.c (rb_str_match): extend warning until 1.8.2.

* string.c (rb_str_match2): ditto.

* class.c (class_instance_method_list): remove 1.8.0 warnings.
  method_list now recurs.  [ruby-dev:21816]

* class.c (rb_obj_singleton_methods): ditto.

* array.c (rb_ary_select): remove select with block.
  [ruby-dev:21824]

* hash.c (rb_hash_select): ditto.

* hash.c (env_select): ditto.

* re.c (match_select): ditto.

* struct.c (rb_struct_select): ditto.

* process.c (check_uid_switch): remove duplicated error messages.

* process.c (check_gid_switch): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-04 09:13:57 +00:00
matz befb570536 * hash.c (rb_hash_each): Hash#each should yield single value.
[ruby-talk:84420]

* hash.c (env_each): ditto for ENV.each.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-24 14:31:14 +00:00
matz cdacb127fc * class.c (rb_obj_singleton_methods): should not go up to
ancestors unless the recursive flag is set. [ruby-list:38007]

* hash.c (env_each_key): use env_keys to avoid environment modify
  on the fly.

* hash.c (env_each_value): use env_values for safety.

* hash.c (env_each): allocate environment array first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 20:16:53 +00:00
matz 601354bd6b * eval.c (BEGIN_CALLARGS): should not always reset ruby_iter,
need to restore previous value. [ruby-talk:77577]

* array.c (rb_ary_fill): array length may be changed during the
  block execution. [ruby-talk:77579]

* array.c (rb_ary_zip): ditto.

* array.c (rb_ary_fill): ditto.

* hash.c (env_reject_bang): length may be changed during the block
  execution.

* hash.c (env_clear): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 02:52:21 +00:00
matz 85911c410a * ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946]

* Minor cleanups.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25 05:36:55 +00:00
matz 5dd2b7102c * gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 18:33:50 +00:00
matz 9ef8a2a5db * lib/matrix.rb: remove elements conversion to_f, to_i, to_r.
* lib/cgi/session/pstore.rb: add new file.

* process.c (proc_getgroups, proc_setmaxgroups): fix typo.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-15 07:35:14 +00:00
nobu 69459d98ef * dir.c (find_dirsep): get rid of warnings.
* eval.c (error_print): temporary value might be disposed by GC.

* hash.c (env_has_value, env_index): should not increment NULL.

* io.c (io_read, rb_io_sysread): not read when length is 0.

* io.c (rb_io_reopen): ensure initialized IO.

* io.c (rb_io_init_copy): sychronize file pointer.

* io.c (rb_io_s_pipe): make exception proof.

* string.c (rb_str_rindex_m): Fixnum 0 matched end of string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23 08:41:07 +00:00
matz 67dcad92b7 * string.c (rb_str_upto): generate sequence according to "succ"
order.  formerly check was done by dictionary order.
  [ruby-talk:74138]

* string.c (rb_string_value): fill constant empty string along
  with setting ELTS_SHARED if str->ptr is NULL. [ruby-core:01179]

* string.c (rb_string_value_ptr): ditto.

* string.c (rb_check_string_type): ditto.

* string.c (str_gsub): move END(0) check before mbclen2().

* string.c (scan_once): reduce END(0) check.

* io.c (rb_io_initialize): accept fixnum mode.

* eval.c (error_print): replace strchr() by memchr(), einfo may
  contain "\0".

* pack.c (pack_unpack): range check for "@" move; initialize check
  for "m".

* error.c (syserr_initialize): avoid buffer overflow.

* file.c (rb_file_s_readlink): expand buffer until readlink
  succeed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23 06:52:39 +00:00
usa 65ba3eba64 * defines.h (PATH_ENV): name of PATH environment. [new].
* defines.h (ENV_IGNORECASE): define for case insensitive platforms
  to access environment variables.

* dln.c (dln_find_exe): use PATH_ENV instead of "PATH".

* hash.c (env_delete, rb_f_getenv, env_fetch, rb_env_path_tainted,
  env_aset): ditto.

* ruby.c (proc_options): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-20 06:22:50 +00:00
usa 7bb51e6ce9 * hash.c (env_delete, rb_f_getenv, env_fetch): case insensitive to
access environment variables on DOSISH platforms.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-19 04:21:25 +00:00
matz 590a37880c * eval.c (proc_alloc): re-unification of Block and Proc. Block
class is no longer available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-16 07:14:50 +00:00
matz bad7546f15 * gc.c (define_final): eliminate rb_f_lambda() call.
* class.c (rb_scan_args): ditto.

* signal.c (sig_trap): ditto.

* hash.c (rb_hash_initialize): ditto.

* variable.c (rb_f_trace_var): ditto.

* ext/dl/dl.c (rb_dl_callback): ditto.

* ext/win32ole/win32ole.c (ev_on_event): ditto.

* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.
  Each END proc should preserve its own $SAFE level. [ruby-core:01119]

* marshal.c (marshal_load): remove unused variable "hash".
  [ruby-core:01120]

* hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860]

* array.c (rb_ary_first): optional argument to retrieve first n
  elements.

* array.c (rb_ary_last): optional argument to retrieve last n
  elements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06 09:44:22 +00:00
matz 9e77e91a13 * eval.c (ruby_cleanup): $SAFE is turned off in the finalization.
Each END proc should preserve its own $SAFE level. [ruby-core:01119]

* marshal.c (marshal_load): remove unused variable "hash".
  [ruby-core:01120]

* hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860]

* array.c (rb_ary_first): optional argument to retrieve first n
  elements.

* array.c (rb_ary_last): optional argument to retrieve last n
  elements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06 09:24:59 +00:00
matz b4fd4d6018 * eval.c (Init_Proc): Block/Proc separation. [huge change]
* eval.c (block_arity): returns exact arity number for Procs out
  of methods. also gives 1 for {|a|..}.

* string.c (rb_str_match): revert use of String#index for
  invocation like string =~ string.

* eval.c (rb_Array): move Object#to_a exclusion hack from
  splat_value().  need to be in eval.c for a while.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-26 08:22:33 +00:00