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

77 Коммитов

Автор SHA1 Сообщение Дата
matz 0f36ecebe0 * string.c (rb_str_clear): avoid revealing NULL pointer.
[ruby-dev:24766]

* string.c (str_gsub): add paranoid check. [ruby-dev:24827]

* string.c (str_mod_check): check frozen status as well.
  [ruby-dev:24801]

* lib/mathn.rb (Integer::gcd2): faster implementation by
  <erlercw@siu.edu>. [ruby-talk:120232]

* ext/gdbm/gdbm.c (fgdbm_store): StringValue() may alter string
  pointer.  [ruby-dev:24783]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-14 15:41:40 +00:00
matz 683400f427 * dir.c (rb_glob2): do not allocate buffer from heap to avoid
memory leaks.  use string object for buffering instead.
  [ruby-dev:24738]

* dir.c (join_path): ditto.

* io.c (io_read): external input buffer may be modified even after
  rb_str_locktmp().  [ruby-dev:24735]

* dir.c (fnmatch): p or s may be NULL.  [ruby-dev:24749]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-10 07:17:53 +00:00
matz 5de7917c8e * pack.c (pack_pack): pointer modification check before each
iteration.  [ruby-dev:24445]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-08 03:36:54 +00:00
matz 6299619da9 * pack.c (pack_unpack): string conversion should at the top of the
method.  [ruby-dev:24439]

* io.c (io_read): buffer should be frozen only after the length
  check.  [ruby-dev:24440]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-07 04:06:41 +00:00
ocean 29c3cb6d20 * array.c, enum.c, pack.c: rdoc patch from Johan Holmberg
<holmberg@iar.se> [ruby-core:3132] [ruby-core:3136]

* numeric.c: rdoc patch.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-09 13:38:34 +00:00
nobu 67ffc9d9e1 * pack.c (pack_pack): always add with null for 'Z'.
* pack.c (pack_unpack): terminated by null for 'Z'.  [ruby-talk:98281]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-13 02:04:20 +00:00
nobu 92f0be2037 * dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,
lib/date.rb, lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb,
  lib/matrix.rb, lib/monitor.rb, lib/set.rb, lib/thwait.rb,
  lib/timeout.rb, lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb,
  lib/net/ftp.rb, lib/net/http.rb, lib/net/imap.rb, lib/net/pop.rb,
  lib/net/telnet.rb, lib/racc/parser.rb, lib/rinda/rinda.rb,
  lib/rinda/tuplespace.rb, lib/shell/command-processor.rb,
  lib/soap/rpc/soaplet.rb, lib/test/unit/testcase.rb,
  lib/test/unit/testsuite.rb: typo fix.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-18 23:19:47 +00:00
matz df84c64be9 * pack.c (pack_pack): use NUM2INT() instead of num2i32().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 06:30:15 +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 189febdf24 * pack.c (pack_pack): raises RangeError if uv is out of UTF8 value
range.  [ruby-dev:23281]

* io.c (rb_io_binmode): stdio buffer should be empty when calling
  IO#binmode.  [ruby-talk:96155]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-31 02:59:57 +00:00
matz 7df46a4493 * pack.c (num2i32): pack should not raise RangeError.
[ruby-dev:22654]

* pack.c (pack_pack): do not auto convert nil to zero.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-22 18:06:38 +00:00
matz caaac4db27 * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
[ruby-dev:22486]

* pack.c (pack_unpack): unpack requires big endian offet (OFF16B
  and OFF32B).  The patch is from Minero Aoki in [ruby-dev:22489]

* pack.c (OFF16B): add big-endian offset again.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-05 10:01:54 +00:00
matz b9a79bc020 * io.c (rb_f_backquote): need not to check nil result.
[ruby-core:02078]

* io.c (rb_io_getline): should return nil on eof, even when nil rs is
  specified. [ruby-core:02077]

* pack.c (pack_pack): add sign check for 'i', and 'l'.
  [ruby-dev:22427]

* bignum.c (rb_quad_pack): add range check for 'quad int'.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-26 15:34:33 +00:00
matz 0a4fc3d71b * io.c (read_all): do not return nil at the end of file.
[ruby-dev:22334]

* io.c (argf_read): do not depend on nil at eof behavior of
  IO#read().

* eval.c (rb_thread_join): dup exception before re-raising it.

* io.c (rb_io_eof): call clearerr() to prevent side effect.  this
  patch is supplied by Masahiro Sakai <sakai@tom.sfc.keio.ac.jp>.
  [ruby-dev:22234]

* pack.c (OFF16): get offset for big endian machines.

* pack.c (pack_pack): use OFF16 instead of OFF16B.
  [ruby-dev:22344]

* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23 19:53:45 +00:00
matz dbc5af97c7 * pack.c (pack_pack): remove unnecessary negative value check.
[ruby-dev:22329]

* io.c (rb_io_ungetc): need fflush before ungetc if write buffer
  is filled. [ruby-dev:22330]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23 10:02:17 +00:00
dave 84f0b051de Annotate enum.c. Add pager support, and report on methods in included modules
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-18 21:08:25 +00:00
matz 64b15d9822 * pack.c: define swap16 and swap32 only if they are not
defined. OpenBSD defines these macros. [ruby-dev:22181]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-08 03:47:04 +00:00
matz b0acbc4c9a * pack.c (htov16): converts endian using swap16. htov32(), hton16,
hton32 as well. [ruby-talk:85377]

* pack.c (swap16): swap 2 bytes no matter how big short is on the
  platform.  swap32() is also prepared.

* numeric.c (rb_num2int): returns long to preserve information.
  rb_fix2int(), rb_num2uint(), rb_fix2uint() as well.
  [ruby-talk:85377]

* numeric.c (rb_num2uint): should not check for value range if the
  source value is negative.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-01 08:42:53 +00:00
matz 90a88ab9a0 * marshal.c (r_object0): remove unnecessary iv restoration for
USRMARSHAL. [ruby-dev:21582]

* marshal.c (w_object): dump generic instance variables from
  a string from '_dump'.

* variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR
  is not set.

* time.c (time_dump): copy instance variables to dumped string, to
  be included in the marshaled data.

* bignum.c (rb_big2ulong): add range check to ensure round trip.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 17:45:53 +00:00
matz 0b2e94b2ab * pack.c (uv_to_utf8): change message to "out of range", since
negative values are not "too big". [ruby-dev21567]

* marshal.c (w_object): should pass the value of "weak" to
  w_object().  [ruby-dev:21555] and [ruby-dev:21561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 06:46:40 +00:00
matz 662e3cf1f9 * eval.c (rb_load): put rb_load_file() in a thread critical
section. [ruby-dev:20490]

* eval.c (compile): put rb_compile_string() in a thread critical
  section.

* variable.c (rb_const_get_0): should not warn if constant is not
  defined. (ruby-bugs-ja PR#509)

* bignum.c (rb_big2dbl): give a warning on overflow.
  (ruby-bugs-ja PR#510)

* util.c (ruby_strtod): change MDMAXEXPT from 511 to 308.

* pack.c (utf8_to_uv): long is sufficient.  LONG_LONG is not
  required.

* bignum.c (rb_big2str): support 32 bit (without `long long' type)
  machines. (ruby-bugs-ja PR#512)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-09 22:28:42 +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
nobu 228604473d * pack.c (pack_unpack): sign-extend if sizeof long is bigger than
32.  (ruby-bugs-ja:PR#472)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-23 06:16:20 +00:00
matz e11f6de3c5 * ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove struct
size check.  getnameinfo(3) can handle. [ruby-dev:19967]

* io.c (io_read): do not call rb_sys_fail() when required data
  length is zero. (ruby-bugs-ja PR#420)

* eval.c (umethod_proc): should raise TypeError, instead of
  returning error causing Proc.  Following the principle of "fail
  early".  [ruby-core:00927]

* pack.c (pack_pack): small but serious typo.

* eval.c (backtrace): skip internal allocator frame.
  (ruby-bugs-ja PR#416)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-07 06:58:31 +00:00
matz 5bfef93c44 * pack.c (pack_pack): do not call rb_str_buf_cat() with NULL ptr,
which causes SEGV; jump to grow instead. [ruby-dev:19944]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-29 11:17:55 +00:00
michal 9df466b287 Updated Copyrights of Matz to 2003.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:34:03 +00:00
matz 6e1f15fc8b * parse.y (list_append): avoid O(n) search using node->nd_next->nd_end.
* parse.y (list_append): ditto.

* eval.c (rb_eval): NODE_ARRY nd_end adoption.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-14 07:45:19 +00:00
akr 9be47132af * pack.c (utf8_limits): fix the limit of 4 bytes UTF-8 sequence.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-10 08:32:54 +00:00
matz 60b2446bea * sprintf.c (rb_f_sprintf): preceding ".." for negative numbers
still left;  removed.

* sprintf.c (rb_f_sprintf): should not prepend '0' if width > prec
  for example "%5.3d".

* process.c (Init_process): add Process.exit and Process.abort

* pack.c (utf8_to_uv): raise ArgumentError for malformed/redundant
  UTF-8 sequences.

* process.c (last_status_set): add pid attribute to Process::Status.

* pack.c (uv_to_utf8): limit maximum length of the encoded string
  to 6 bytes, even when the platform supports 8 bytes long integers.

* pack.c (utf8_to_uv): do not decode sequences longer than 6 bytes.

* object.c (copy_object): use "copy_object" method, not "become".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-10 06:23:44 +00:00
matz a526e3fe02 * object.c (copy_object): copy finalizers as well if any.
* gc.c (rb_gc_copy_finalizer): new function to copy finalizers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-04 07:39:32 +00:00
matz e193fd8d66 * pack.c (utf8_to_uv): added checks for malformed or redundant
UTF-8 sequences.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-02 07:13:56 +00:00
matz 7f62113f4d * sprintf.c (rb_f_sprintf): preceding ".." for negative
hexadecimal numbers should not appear if prec (e.g. %.4) is
  specified.

* pack.c (NUM2I32): support platforms which does not have 32bit
  integers (e.g. Cray).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-22 14:30:33 +00:00
michal 0d0ae37e50 Int vs Long cleanup #3 (ruby-core:352)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28 08:05:23 +00:00
michal ffc13a6525 *.c: Int vs Long cleanup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21 15:47:54 +00:00
usa cd6cffa7b6 * pack.c (pack_unpack): change names of local variables because their
names are overlapped.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-28 14:53:03 +00:00
matz 4ab1577db3 * parse.y: yyparse #defines moved from intern.h
* ruby.c (proc_options): access prefixed "ruby_yydebug".

* applied modifies to pacify some of gcc -Wall warnings.

* parse.y (arg): no more ugly hack for "**", so that "-2**2" to be
  parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed
  as "-(2**2)".

* parse.y (yylex): '-2' to be literal fixnum. [new]

* time.c (time_succ): new method for Range support.

* time.c (time_arg): nil test against v[6] (usec).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-29 05:20:39 +00:00
michal bab153b243 * array.c: fixed format string for 'long' args (%d -> %ld).
* class.c: ditto.

	* eval.c: ditto.

	* numeric.c: ditto.

	* pack.c: ditto.

	* parse.y: ditto.

	* range.c: ditto.

	* string.c: ditto.

	* util.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-28 18:11:07 +00:00
matz edbe98d848 * object.c (Init_Object): should do exact match for Module#==.
* compar.c (cmp_eq): returns 'false' if <=> returns 'nil'.

* compar.c (cmp_gt,cmp_ge,cmp_lt,cmp_le,cmp_between): ditto.

* pack.c (pack_pack): should propagate taintedness.

* pack.c (pack_unpack): ditto.

* eval.c (rb_thread_schedule): need to preserve errno before
  calling rb_trap_exec().

* regex.c (calculate_must_string): a bug in charset/charset_not
  parsing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-21 05:39:19 +00:00
matz eb6118992b * eval.c (rb_clear_cache_by_class): new function.
* eval.c (set_method_visibility): should have clear cache forq
  updated visibility.

* numeric.c (flo_to_s): default format precision to be "%.16g".

* util.c (ruby_strtod): use own strtod(3) implementation to avoid
  locale hell.  Due to this change "0xff".to_f no longer returns 255.0

* eval.c (avalue_to_yvalue): new function to distinguish yvalue
  (no-arg == Qundef) from svalue (no-arg == Qnil).

* eval.c (rb_yield_0): use avalue_to_yvalue().

* eval.c (assign): warn if val == Qundef where it means rhs is
  void (e.g. yield without value or call without argument).

* parse.y (value_expr): need not to warn for WHILE and UNTIL,
  since they can have return value (via valued break).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-14 06:22:31 +00:00
matz b134b91278 * various files: macro fix-up by Michal Rokos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-25 13:57:01 +00:00
matz 9a24232fd2 * pack.c (pack_unpack): should treat 'U' in character unit, not in
byte unit.

* error.c (exc_initialize): should clear backtrace information.

* io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd).

* rubyio.h: remove FMODE_FDOPEN


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-15 07:48:47 +00:00
matz a08cea360d * pack.c (pack_pack): wrong # comment treatment.
* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-21 07:15:06 +00:00
nobu 7ef48b40ba * pack.c (pack_pack): avoid infinite loop at comment.
* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-18 11:51:10 +00:00
matz 7de72c4858 * parse.y (expr_value, arg_value, primary_value): value_expr()
check in place.

* eval.c (block_pass): "&nil" should clear block given.

* dir.c (push_braces): remove MAXPATHLEN dependency.

* dir.c (dir_s_globd): ditto.

* dln.c (init_funcname): ditto.

* dln.c (load_1): ditto.

* dln.c (dln_load): ditto.

* configure.in: add GNU/Hurd switches.

* pack.c (pack_pack): allows comment in template strings.

* pack.c (pack_unpack): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-18 09:52:48 +00:00
matz ba8fc117c5 * parse.y (stmt): local variable declaration order was changed
since 1.6

* parse.y (arg): ditto.

* pack.c (pack_pack): add templates 'q' and 'Q'.

* pack.c (pack_unpack): ditto.

* bignum.c (rb_quad_pack): new utility function.

* bignum.c (rb_quad_unpack): ditto.

* parse.y (assignable): should emit CVASGN within the method
  body.

* dir.c (dir_s_glob): should not warn even if no match found.

* eval.c (rb_eval): clean up class variable behavior.

* eval.c (assign): ditto.

* eval.c (is_defined): ditto.

* variable.c (rb_mod_class_variables): need not to call rb_cvar_singleton().

* variable.c (rb_cvar_singleton): removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-13 09:01:11 +00:00
matz df96f994f1 * parse.y (parse_regx): should raise error on untermitated
expression interpolation.

* pack.c (pack_unpack): should give length to utf8_to_uv().

* pack.c (utf8_to_uv): add length check.

* massages: replace "wrong #" by "wrong number".

* marshal.c (w_float): output Infinity and NaN explicitly.

* marshal.c (r_object): support new explicit float format.

* eval.c (rb_thread_wait_for): select may cause ERESTART on
  Solaris.

* eval.c (rb_thread_select): ditto.

* array.c (rb_ary_join): dumped core if sep is not T_STRING nor T_NIL.

* array.c (rb_ary_join): buffer size calculattion was wrong.

* array.c (rb_ary_to_s): if rb_output_fs is nil, insert newlines
  between array elements (use rb_default_rs as newline litral)
  [experimental].

* gc.c (init_mark_stack): no need to clear mark_stack.

* gc.c (gc_mark_all): need to handle finalizer mark.

* gc.c (gc_mark_rest): use MEMCPY instead of memcpy.

* gc.c (rb_gc_mark): earlier const check to avoid pusing special
  constants into mark stack.

* numeric.c (fix_to_s): 'to_s' now takes optional argument to
  specify radix. [new]

* bignum.c (rb_big_to_s): ditto. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-19 05:03:03 +00:00
matz 0f35b58a2f * ruby.c (proc_options): should not alter origargv[].
* ruby.c (set_arg0): long strings for $0 dumped core.

* ruby.c (set_arg0): use setprogtitle() if it's available.

* io.c (rb_io_popen): accept integer flags as mode.

* file.c (rb_find_file_ext): extension table can be supplied from
  outside.  renamed.

* eval.c (rb_f_require): replace rb_find_file_noext by
  rb_find_file_ext.

* eval.c (rb_provided): should also check feature without
  extension.

* numeric.c (flo_to_s): do not rely on decimal point to be '.'


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-03 05:37:42 +00:00
nobu f141f2e543 a problem about `associated' String and `str_buf'.
* pack.c (pack_unpack): associates p/P strings once at
  last(reverted to 1.26).

* string.c (rb_str_associate): associates an Array at once, not
  but a String. realloc's when str_buf.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-06 15:05:50 +00:00
matz f33a61c28d * string.c (rb_str_lstrip_bang): new method.
* string.c (rb_str_rstrip_bang): new method.

* string.c (rb_str_associate): should consider STR_ASSOC too.

* eval.c (rb_undefined): do not recurse if method_missing is
  undefined.

* process.c (proc_waitpid): now all arguments are optional.

* process.c (Init_process): waitpid is now alias to wait.

* process.c (Init_process): waitpid2 is now alias to wait2.

* process.c (rb_waitpid): made public.

* ext/pty/pty.c (pty_getpty): avoid disturbing SIGCHLD using
  thread and rb_waitpid.

* process.c (proc_getpgrp): now takes no argument on all
  platforms.

* process.c (proc_setpgrp): ditto.

* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
  Socket::pack_sockaddr_in(). [new]

* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
  Socket::pack_sockaddr_un(). [new]

* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
  Socket::unpack_sockaddr_in(). [new]

* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
  Socket::unpack_sockaddr_un(). [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-06 03:05:23 +00:00
matz abfaac7a6c * ruby.c (proc_options): unexpected SecurityError happens when -T4.
* regex.c (re_compile_pattern): * \1 .. \9 should be
  backreferences always.

* regex.c (re_match): backreferences corresponding to
  unclosed/unmatched parentheses should fail always.

* string.c (rb_str_cat): use rb_str_buf_cat() if possible. [new]

* string.c (rb_str_append): ditto.

* string.c (rb_str_buf_cat): remove unnecessary check (type,
  taint, modify) to gain performance.

* string.c (rb_str_buf_append): ditto.

* string.c (rb_str_buf_new): buffering string function. [new]

* string.c (rb_str_buf_append): ditto.

* string.c (rb_str_buf_cat): ditto.

* time.c (make_time_t): local time adjustment revised.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-30 09:12:34 +00:00