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

103 Коммитов

Автор SHA1 Сообщение Дата
ocean 30fd29a174 * ruby.h, dir.c (rb_glob): add const.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-15 06:34:21 +00:00
matz 7a987b9bcd * dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
[ruby-dev:22761]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-29 08:05:29 +00:00
matz 51e6d9061d * misc/ruby-mode.el: better support for general delimited
strings.  [ruby-dev:22695]

* lib/weakref.rb (WeakRef::initialize): set up @__id before
  calling "super".

* lib/delegate.rb (Delegator::initialize): preserve
  singleton_method_added method [ruby-dev:22685]

* lib/delegate.rb (Delegator::initialize): use Kernel::raise
  instead of mere raise.  [ruby-dev:22681]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-27 06:05:04 +00:00
matz 6760a5ed9f * parse.y (primary): allow no "when" case. [ruby-dev:22578]
* ruby.h (rb_class_of): reduce branch. [ruby-dev:22577]

* ruby.h (rb_type): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-13 05:48:59 +00:00
nobu 748b699d1b * configure.in (ac_cv_func_setitimer): moved from defines.h
* defines.h, rubysig.h, signal.c: removed macro handling which
  should be done in configure.

* configure.in (intrinsics.h): check if present.

* ruby.h: include intrinsics.h if available.

* bignum.c, marshal.c: include ieeefp.h if available.

* missing.h (isinf): define as a macro if finite() and isnan()
  are available.  [ruby-core:02032]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-22 08:23:55 +00:00
nobu faab8f264d * configure.in (ieeefp.h), numeric.c: needed for finite() on
Solaris.  [ruby-core:01921]

* file.c (rb_stat_inspect): adjust format specifier.

* parse.c (arg_prepend): nodetype() is for debug use.

* ruby.h (ISASCII, etc): cast to int to get rid of warning.

* ruby.h (alloca.h): include even in GCC.  [ruby-core:01925]

* ext/bigdecimal/bigdecimal.c (GetVpValue): adjust format
  specifier.

* ext/bigdecimal/bigdecimal.c (BigDecimal_prec, BigDecimal_coerce,
  BigDecimal_divmod): use rb_assoc_new() to suppress memory usage.

* ext/bigdecimal/bigdecimal.c (BigDecimal_split): ditto.

* ext/dl/sym.c (rb_dlsym_guardcall): guard itself should be
  volatile.

* ext/iconv/iconv.c (iconv_convert): ensure actual parameter with
  format specifier.

* ext/pty/pty.c (MasterDevice, SlaveDevice, deviceNo): do not
  define unless used.

* ext/pty/pty.c (getDevice): get rid of warning.

* ext/socket/socket.c (port_str, sock_s_getaddrinfo,
  sock_s_getnameinfo): FIX2INT() now returns long.

* ext/socket/socket.c (init_inetsock_internal): uninitialized
  variable.

* ext/syck/rubyext.c (syck_parser_assign_io): add prototype.

* ext/syck/rubyext.c (rb_syck_mktime, yaml_org_handler): use
  ISDIGIT() instead of isdigit() to avoid warnings and for
  platforms which don't support non-ascii charater.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11 02:39:59 +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
eban ec373c3e1c * ruby.h: don't treat Cygwin as Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-25 07:17:14 +00:00
nagai c5061b6116 * check existence of "pthread.h"
* define is_ruby_native_thread() macro when not HAVE_NATIVETHREAD


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 16:47:30 +00:00
nagai b33ea38a9b * ruby.h: define is_ruby_native_thread() for no native thread environment
* eval.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 04:39:08 +00:00
nagai 340a511fdf * configure.in: always check existence of the pthread library
* ruby.h: define macros for ruby's native thread check
* eval.c: add ruby's native thread check
* gc.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 03:50:32 +00:00
nobu 921d595fd4 * intern.h (ruby_stop): never return.
* ruby.h (ruby_run): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-14 02:53:53 +00:00
matz 7ff7bcbf9d * enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto.

* eval.c (rb_yield_splat): new function to call "yield *values".

* string.c (rb_str_scan): use rb_yield_splat().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-22 08:09:58 +00:00
usa 28cbfaba2b * ruby.h (LLONG_MIN): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29 08:28:54 +00:00
matz 37b2487c70 * lib/net/smtp.rb (Net::SMTP::send0): add taint check.
* ruby.h (LLONG_MIN): wrong value.

* io.c (rb_f_getc): $stdin may not be IO. [ruby-dev:20973]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29 07:52:55 +00:00
matz dea1baa169 * ext/stringio/stringio.c (strio_gets): only "gets" should set $_.
* ext/stringio/stringio.c (strio_getline): should not set $_ here.

* io.c (argf_to_s): argf.to_s returns "ARGF".

* io.c (set_defout_var, set_deferr_var): make $defout and $deferr
  obsolete.

* io.c (set_input_var, set_output_var): allow $stdin, $stdout,
  $stderr not to be instance of IO.

* io.c (rb_f_readline): forward method to current_file. gets,
  readline, readlines, getc, readchar, tell, seek, pos=, rewind,
  fileno, to_io, eof, each_line, each_byte, binmode, and closed?
  as well.

* io.c (argf_forward): utility function to forward method to
  current_file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-28 07:31:52 +00:00
matz e4de8e7566 * string.c: use StringValueCStr to retrieve paths to system calls.
* string.c (rb_string_value_cstr): check null byte in the string
  before retrieving C ptr.  accessed via macro StringValueCStr.

* file.c (sys_fail2): raise error for two operand system calls
  such as rename, link, symlink.  (ruby-bugs PR#1047)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-20 17:17:52 +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
matz f7afa61a0a * eval.c: remove rb_cBlock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-17 03:12:28 +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
nobu 045eb9773e * numeric.c (rb_num2uint, rb_fix2int): new function to convert
values over INT_MAX.  [ruby-core:01099]

* ruby.h (NUM2UINT, FIX2INT): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-30 13:28:10 +00:00
matz 82cf98939f * eval.c (rb_yield_0): give warning for multiple values for a
block parameter.

* eval.c (rb_yield_values): a function to yield multiple values.

* array.c (sort_1): use rb_yield_values.

* enum.c (min_ii, max_ii): ditto.

* hash.c (rb_hash_update_block_i, delete_if_i, select_i,
  each_pair_i, env_each, env_reject_bang, env_select,
  env_update_i): ditto.

* struct.c (rb_struct_each_pair): ditto.

* eval.c (top_include): should include module in the current self,
  not ruby_top_self. [ruby-dev:20198]

* eval.c (top_include): stop inclusion to ruby_wrapper; give
  warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-20 06:29:23 +00:00
matz 5e8a9873a2 * eval.c (error_pos): use $deferr for output instead of stderr
directly.

* eval.c (error_print,error_handle,rb_longjmp,rb_thread_schedule):
  ditto.

* io.c (Init_IO): new variable $deferr which is default output
  port of error messages.

* io.c (rb_warn_m): new method "warn". [new]

* error.c (warn_print): use $deferr.

* error.c (rb_bug): ditto.

* error.c (err_append): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-13 05:53:08 +00:00
matz d4db9e9c60 * io.c (rb_io_initialize): should check rb_secure(4).
* dir.c (dir_s_getwd): should check rb_secure(4).

* object.c (rb_obj_infect): function version of OBJ_INFECT().

* eval.c (rb_secure_update): new function to check object update.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25 03:11:27 +00:00
matz ece972717b security enhancement of dl library (need test).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-24 09:38:37 +00:00
nobu f3bdfcc416 * configure.in, bcc32/Makefile.sub, win32/Makefile.sub: define
RUBY_EXPORT to export symbols.

* defines.h: use RUBY_EXTERN instead of EXTERN.

* intern.h, re.h, ruby.h, rubysig.h: ditto.

* win32/win32.h: remove EXTERN definition.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-04 14:12:19 +00:00
nobu 8fc90b887b * intern.h (HAVE_RB_DEFINE_ALLOC_FUNC, RB_CVAR_SET_4ARGS):
define to 1.

* ruby.h (NORETURN_STYLE_NEW): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-09 06:16:08 +00:00
knu 0644ac3f8e * intern.h (HAVE_RB_DEFINE_ALLOC_FUNC): New boolean macro to make
it easier to write extensions that work with both ~1.6 and 1.8~.

* intern.h (RB_CVAR_SET_4ARGS): Ditto.

* ruby.h (NORETURN_STYLE_NEW): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-07 18:37:03 +00:00
matz 74d5623029 * variable.c (rb_obj_classname): new function.
* string.c (rb_str_dup): should preserve original's class (but not
  hidden singleton class).

* string.c (rb_str_substr): ditto.

* parse.y: backout EXPR_CMDARG removal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-31 04:00:17 +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
knu a2868ff651 * eval.c, file.c, gc.c, io.c, object.c, ruby.c, ruby.h, struct.c,
ext/socket/socket.c: differentiate long and int; use proper
  printf type specifiers and do casts where appropriate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-29 21:35:28 +00:00
michal 6f92767afc capa field in RString, and RArray is now LONG (ruby-lang:458)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-09 10:26:02 +00:00
matz 6f484e4930 * variable.c (rb_copy_generic_ivar): remove old generic instance
variable table if it existes.

	* class.c (rb_make_metaclass): metaclass of a metaclass is a
	  metaclass itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 05:20:14 +00:00
matz 40bc4f5ae4 * array.c (rb_ary_become): should not free ptr if it's shared.
* eval.c (rb_alias): prohibit making an alias named "allocate" if
  klass is a metaclass.

* string.c (rb_string_value_ptr): StringValuePtr() should never
  return NULL pointer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-29 09:08:18 +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
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
eban 64db3a3251 * forgot to commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-11 19:34:13 +00:00
matz e3a8c62630 * io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.
* io.c (rb_io_mode_modenum): ditto.

* gc.c (rb_memerror): rename from mem_error, and exported.

* gc.c (Init_GC): pre-allocate NoMemoryError instance.

* object.c (convert_type): error message changed from "failed to
  convert" to "cannot convert", since it does not try to convert
  if an object does not respond to the converting method.

* eval.c (block_pass): convert Method to Proc using
  rb_check_convert_type().

* object.c (rb_check_convert_type): always convert T_DATA

* eval.c (rb_thread_cleanup): should not terminate main_thread by
  Fatal error.

* regex.c (is_in_list): need to not exclude NUL and NEWLINE.

* re.c (rb_reg_expr_str): wrong backslash escapement.

* re.c (rb_reg_expr_str): do not escape embedded space
  characters.

* marshal.c (w_object): T_DATA process patch from Joel VanderWerf
  <vjoel@PATH.Berkeley.EDU>.  This is temporary hack; it remains
  undocumented, and it will be removed when marshaling is
  re-designed.

* marshal.c (r_object): ditto.

* numeric.c (num_step): Integer#step is moved to Numeric#step;
  Fixnum#step is merged into this method.

* numeric.c (int_dotimes): Fixnum#times is merged.

* numeric.c (int_upto): Fixnum#upto is merged.

* numeric.c (int_downto): Fixnum#downto is merged.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24 04:54:16 +00:00
matz e63a990141 * re.c (rb_reg_expr_str): should treat backslash specially in
escaping.

* io.c: complete off_t handling; missing argument for
  fptr_finalize(); polished rb_scan_args call.

* dir.c: wrap multi-statment macro by do { } while (0)

* eval.c, numeric,c, sprintf.c, util.c: ditto.

* bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum,
  Bignum, nor Float.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-18 08:46:18 +00:00
matz cf06d8b20b * io.c (rb_io_sysseek): new method based on a patch from Aristarkh
A Zagorodnikov <xm@bolotov-team.ru>. [new]

* io.c (READ_DATA_PENDING): use !feof(fp) for default behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27 05:28:00 +00:00
matz 2bd0c2bf73 * the VMS support patch submitted by Akiyoshi, Masamichi
<Masamichi.Akiyoshi@jp.compaq.com> is merged.

* eval.c (exec_under): changing ruby_class is OK, but should not
  alter cbase.

* eval.c (yield_under_i): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-22 07:26:42 +00:00
usa 6ba0d31e8f * bignum.c, intern.h (rb_ull2big, rb_ll2big, rb_ull2inum, rb_ll2inum,
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of
  long long.
* numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto.
* ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-15 08:51:31 +00:00
matz 997b69cb6a * re.c (rb_reg_match): should clear $~ if operand is nil.
* re.c (rb_reg_match2): ditto.

* configure: merge Jonathan Baker's large file support patch
  [ruby-talk:35316], with read_all patch in [ruby-talk:35470].

* eval.c (rb_f_abort): optional message argument that be printed
  on termination. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14 06:23:46 +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
nobu e93b8f1c89 * dln.h, ruby.h, util.h: enable prototypes in C++.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-21 07:20:23 +00:00
nobu cd956b3114 * intern.h: add prototypes.
rb_gc_enable(), rb_gc_disable(), rb_gc_start(), rb_str_new5()
  rb_str_buf_append(), rb_str_buf_cat(), rb_str_buf_cat2(),
  rb_str_dup_frozen()

* ruby.h: added declaration.
  rb_defout, rb_stdin, rb_stdout, rb_stderr, ruby_errinfo

* rubyio.h: changed double include guard macro to RUBYIO_H.

* array.c (inspect_call): make static.

* eval.c (dvar_asgn): ditto.

* io.c (rb_io_close_read): ditto.

* lex.c (rb_reserved_word): ditto.

* ruby.c: (req_list_head, req_list_last): ditto.

* ruby.c (require_libraries): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 07:52:35 +00:00
matz c79368b6a3 auxiliary routines update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10 07:24:00 +00:00
matz 2f8d3bdc21 * array.c (rb_ary_modify): should copy the internal buffer if the
modifying buffer is shared.

* array.c (ary_make_shared): make an internal buffer of an array
  to be shared.

* array.c (rb_ary_shift): avoid sliding an internal buffer by
  using shared buffer.

* array.c (rb_ary_subseq): avoid copying the buffer.

* parse.y (gettable): should freeze __LINE__ string.

* io.c (rb_io_puts): old behavoir restored.  rationale: a) if you
  want to call to_s for arrays, you can just call print a, "\n".
  b) to_s wastes memory if array (and sum of its contents) is
  huge.  c) now any object that has to_ary is treated as an array,
  using rb_check_convert_type().

* hash.c (rb_hash_initialize): now accepts a block to calculate
  the default value. [new]

* hash.c (rb_hash_aref): call "default" method to get the value
  corrensponding to the non existing key.

* hash.c (rb_hash_default): get the default value based on the
  block given to 'new'.  Now it takes an optinal "key" argument.
  "default" became the method to get the value for non existing
  key.  Users may override "default" method to change the hash
  behavior.

* hash.c (rb_hash_set_default): clear the flag if a block is given
  to 'new'

* object.c (Init_Object): undef Data.allocate, left Data.new.

* ext/curses/curses.c (window_scrollok): use RTEST().

* ext/curses/curses.c (window_idlok): ditto.

* ext/curses/curses.c (window_keypad): ditto.

* ext/curses/curses.c (window_idlok): idlok() may return void on
  some platforms; so don't use return value.

* ext/curses/curses.c (window_scrollok): ditto for consistency.

* ext/curses/curses.c: replace FIX2INT() by typechecking NUM2INT().

* parse.y (str_extend): should not process immature #$x and
  #@x interpolation, e.g #@#@ etc.

* enum.c (enum_sort_by): sort_by does not have to be stable always.

* enum.c (enum_sort_by): call qsort directly to gain performance.

* util.c (ruby_qsort): ruby_qsort(qs6) is now native thread safe.

* error.c (rb_sys_fail): it must be a bug if it's called when
  errno == 0.

* regex.c (WC2MBC1ST): should not pass through > 0x80 number in UTF-8.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10 07:18:16 +00:00
matz dc98adf839 * process.c (security): always give warning for insecure PATH.
* dir.c (my_getcwd): do not rely on MAXPATHLEN.

* file.c (rb_file_s_readlink): ditto.

* file.c (path_check_1): ditto.

* eval.c (rb_yield_0): should not call rb_f_block_given_p().

* string.c (rb_str_chomp_bang): should terminate string by NUL.

* eval.c (rb_yield_0): better error message.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-08 06:43:14 +00:00
matz 88abd791f5 * parse.y (str_extend): shuould allow interpolation of $-x.
* variable.c (rb_cvar_set): empty iv_tbl may cause infinite loop.

* variable.c (rb_cvar_get): ditto.

* variable.c (cvar_override_check): ditto.

* bignum.c (rb_big_eq): convert Bignum to Float, instead of
  reverse.

* time.c (time_localtime): getting tm should not be prohibited for
  frozen time objects.

* time.c (time_gmtime): ditto.

* version.c (Init_version): freeze RUBY_VERSION,
  RUBY_RELEASE_DATE, and RUBY_PLATFORM.

* file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and
  PATH_SEPARATOR.

* file.c (rb_stat_cmp): should check operand type before calling
  get_stat().

* eval.c (rb_eval_cmd): should not invoke "call" with a block on
  any occasion.

* numeric.c (fix_aref): idx may be a Bignum.

* numeric.c (num_remainder): a bug in Numeric#remainder.

* eval.c (rb_exec_end_proc): END might be called within END
  block.

* class.c (rb_mod_clone): should not copy class name, since clone
  should remain anonymous.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-29 05:07:26 +00:00