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

901 Коммитов

Автор SHA1 Сообщение Дата
nobu 9ffccf4762 * eval.c (rb_yield_0): restore source file/line after yield.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23 07:24:26 +00:00
nobu 68f6704478 * signal.c (ruby_signal): must define sighandler_t unless
POSIX_SIGNAL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-21 13:59:41 +00:00
matz b03bdcd64f * eval.c (ruby_stop): should not trace error handler.
* signal.c (install_sighandler): do not install sighandler unless
  the old value is SIG_DFL.

* io.c (io_write): should not raise exception on O_NONBLOCK io.

* dir.c (dir_set_pos): seek should return dir, pos= should not.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-21 07:44:06 +00:00
matz d102ce6d09 * eval.c (rb_eval): need not to clar method cache for NODE_CLASS,
NODE_SCLASS.

* gc.c (obj_free): need not to clear method cache on class/module
  finalization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-19 14:22:27 +00:00
matz a7a7324ea6 * io.c (rb_io_s_new): block check moved from initialize to this
method.

* io.c (rb_io_s_open): open should call initialize too. IO#for_fd
  also calls initialize. [new]

* error.c (rb_sys_fail): replace INT2FIX() by INT2NUM() since
  errno value may not fit in Fixnum size on Hurd.

* error.c (set_syserr): ditto.

* dir.c (dir_s_glob): returns nil if block given.

* io.c (rb_io_each_byte): should return self.

* io.c (rb_io_close_m): close check added.

* dir.c (dir_seek): should return pos.

* parse.y (fixpos): orig may be (NODE*)1, which should not be
  dereferenced.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-18 14:24:01 +00:00
usa 9bb82109f7 * ext/socket/socket.c (tcp_svr_s_open): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-18 01:13:58 +00:00
matz 36192dfa4a * eval.c (block_pass): allow "retry" from within argument passed
block. [new]

* eval.c (localjump_error): should preserve exit status in the
  exception object. [new]

* eval.c (proc_invoke): should raise exception for "break" if it's
  yielding, not calling. [new]

* eval.c (block_pass): should NOT raise exception for "break". [new]

* eval.c (block_pass): should allow block argument relay even in
  the tainted mode.

* ext/socket/socket.c: support subclassing by proper "initialize"
  calling convention. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-17 08:05:01 +00:00
matz c0a636b6f9 * st.c: primes should be primes.
* eval.c (is_defined): method defined? check should honor
  protected too.

* eval.c (block_pass): should not pass tainted block, if $SAFE > 0.

* variable.c (rb_mod_remove_cvar): should pass the char*.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16 09:25:59 +00:00
akr 17e1cfef8c * lib/timeout.rb (timeout): new optional argument to specify an
exception class.

* lib/resolv.rb: use Resolv::ResolvTimeout for internal timeout to
avoid problem with timeout of application.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16 03:37:23 +00:00
nobu 5fe2879fd5 * object.c (rb_Float): remove underscores between digits.
* bignum.c (rb_cstr2inum): reject prefix followed by spaces only.

* class.c (rb_class_inherited): should use Object when no super
  class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16 02:20:25 +00:00
matz 85e32dd221 * re.c (match_select): should propagate taintness.
* hash.c (rb_hash_set_default): Hash#default= should return the
  new value.

* string.c (rb_str_to_i): accepts optional base argument. [new]

* numeric.c (rb_fix2str): should not handle negative fixnum values
  int32 via calling sprintf() directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-11 09:18:54 +00:00
nobu 5915dc245e * class.c (rb_make_metaclass): [new]
* class.c (rb_define_class_id): use rb_make_metaclass(), don't
  call Class#inherited hook.

* class.c (rb_class_inherited): [new]

* class.c (rb_define_class): call Class#inherited hook here.

* class.c (rb_define_class_under): ditto after class path is set.

* class.c (rb_singleton_class): use rb_make_metaclass().

* eval.c (rb_eval): same as rb_define_class_under().

* intern.h: prototypes of rb_make_metaclass() and
  rb_class_inherited().

* object.c (rb_class_s_new): use rb_make_metaclass() and
  rb_class_inherited().

* object.c (Init_Object): use rb_make_metaclass().

* struct.c (make_struct): use rb_class_inherited().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10 20:18:39 +00:00
nobu 1b4be57f7e * eval.c (rb_add_method): should clear cache by id always.
* eval.c (rb_disable_super): no longer need to clear cache before
  rb_add_method().

* eval.c (rb_export_method): ditto.

* eval.c (rb_attr): ditto.

* eval.c (rb_undef): ditto.

* eval.c (rb_eval): ditto.

* eval.c (rb_mod_modfunc): ditto.

* eval.c (rb_mod_define_method): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10 13:30:17 +00:00
usa d92e9de3b8 * win32/resource.rb: Modify copyright in resource script.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10 02:43:06 +00:00
nobu dffbc4d7f1 * misc/ruby-mode.el (ruby-calculate-indent): indentation after
comment at beginning of buffer failed.

* misc/ruby-mode.el (font-lock-defaults): unless XEmacs, set
  font-lock variables in ruby-mode-hook.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-09 17:52:12 +00:00
nobu 1a101d775a * eval.c (rb_add_method): clear replaced method from the cache.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-08 07:02:26 +00:00
matz c9f4686694 * string.c (rb_str_new2): NULL pointer check added.
* class.c (rb_define_module_under): should locate predefined
  module using rb_const_defined_at().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-07 05:27:01 +00:00
akr 6a100f3ce4 * lib/time.rb (Time#xmlschema): new optional argument
fractional_seconds to specify a number of digits of
fractional part of the time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-07 03:56:55 +00:00
nobu 427237f889 misordered.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-05 16:09:46 +00:00
nobu 1cc7986a11 * range.c (range_member): beginning check was
wrong. [ruby-talk:30252]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-05 04:19:58 +00:00
nobu 8090c2f214 * misc/ruby-mode.el (ruby-forward-string): forward a string. [new]
* misc/ruby-mode.el (ruby-parse-region): handle nested parentheses
  in a string and terminators in #{}.

* misc/ruby-mode.el (ruby-calculate-indent): ditto.

* misc/ruby-mode.el (ruby-font-lock-syntactic-keywords):
  fix font-lock problem [ruby-talk:29296].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-05 03:25:02 +00:00
nobu bb8805c9f8 * parse.y (yycompile): strdup()'ed twice.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-04 15:23:26 +00:00
matz 2c2694e846 * process.c (rb_f_system): abandon vfork.
* io.c (pipe_open): ditto.

* defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS

* regex.c (re_search): abandon stclass optimization.

* bignum.c (rb_cstr2inum): deny "0_".

* bignum.c (rb_cstr2inum): allow "0\n" and so on.

* error.c (rb_invalid_str): utility function to show inspect()'ed
  string.

* bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed
  format.

* object.c (rb_Float): ditto.

* object.c (rb_convert_type): no longer use rb_rescue().

* re.c (rb_reg_search): initialize taint status of match object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-03 16:01:35 +00:00
eban 167dd9c933 * lib/mkmf.rb (create_makefile): add -I. to CPPFLAGS.
* lib/mkmf.rb (create_makefile): srcdir support(.def and depend file).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-02 14:42:01 +00:00
eban 7fa449a44a * ext/curses/extconf.rb: add dir_config.
* Makefile.in (fake.rb): set RUBY_VERSION.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-31 17:48:33 +00:00
nobu c891189693 * parse.y (yycompile): always store copy of filename.
* parse.y (rb_compile_file): no longer need to strdup() here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-31 05:26:24 +00:00
aamine f3d9a0cc21 aamine
* lib/net/protocol.rb: Protocol#start returns the return value of block.
* lib/net/protocol.rb: set timeout limit by default.
* lib/net/protocol.rb: new methods WriteAdapter#write, puts, print, printf.
* lib/net/http.rb: rename HTTP#get2 to request_get, post2 to request_post ...
* lib/net/smtp.rb: should not resolve HELO domain automatically.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-30 19:18:45 +00:00
eban b8c26d48bc * ext/extmk.rb.in, lib/mkmf.rb (have_library): accept -lm
unconditionally on mswin32/mingw32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-29 16:10:24 +00:00
nobu a59cf8edc5 * array.c (rb_cmpint): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-28 05:42:23 +00:00
nobu 3b4641a4bf * bignum.c (rb_cstr2inum): deny "0_".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-27 09:53:54 +00:00
nobu d0c78c8567 * bignum.c (rb_cstr2inum): allow "0\n" and so on.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-26 17:01:20 +00:00
akr cecb258bdf * lib/pp.rb, lib/prettyprint.rb: new files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-24 18:10:20 +00:00
matz 4282698219 * time.c (time_timeval): wrong cast to time_t.
* time.c (time_plus): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-22 16:58:16 +00:00
matz 0a45dee5a5 * parse.y (str_extend): make up "#$;" handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-22 02:51:00 +00:00
matz 63b6b9c430 * time.c (time_plus): result should not be negative unless
NEGATIVE_TIME_T is defined.

* time.c (time_new_internal): should check tv_sec overflow too.

* time.c (time_timeval): should check time_t range when time is
  initialized from float.

* time.c (time_plus): uses modf(3).

* variable.c (rb_cvar_set): add frozen class/module check.

* variable.c (rb_cvar_declare): add frozen class/module check.

* re.c (match_to_a): should propagate taint.

* re.c (rb_reg_s_quote): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-21 09:23:28 +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 c29a112e14 * eval.c (rb_mod_define_method): must not convert Method to Proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-20 18:19:42 +00:00
nobu b7a58b0650 * lib/mkmf.rb (with_destdir): new.
* lib/mkmf.rb: prefix target directories with $(DESTDIR) all.

* lib/mkmf.rb: no need to mkdir $(libdir)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-20 16:23:27 +00:00
aamine 5a4187f2c2 aamine
* lib/net/protocol.rb: rename Net::Socket to Net::BufferedSocket


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-20 05:00:20 +00:00
shugo a76e21e612 * ext/readline/readline.c: new methods
Readline::basic_word_break_characters,
	Readline::basic_word_break_characters=,
	Readline::completer_word_break_characters,
	Readline::completer_word_break_characters=,
	Readline::basic_quote_characters,
	Readline::basic_quote_characters=,
	Readline::completer_quote_characters,
	Readline::completer_quote_characters=,
	Readline::filename_quote_characters,
	Readline::filename_quote_characters=.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-19 08:02:55 +00:00
matz ee87eb1367 * eval.c (rb_mod_define_method): define_method should follow
default method visibility.

* eval.c (rb_attr): should warn if the default method visibility
  is "module_function" (can be error).

* eval.c (rb_mod_define_method): should define class/module method
  also if the visibility is "module_function".

* eval.c (rb_mod_define_method): should call hook method
  "method_added", and "singleton_method_added".

* string.c: use RESIZE_CAPA for capacity change.

* ext/socket/socket.c (Init_socket): add listen method to
  TCPServer and UNIXServer.

* ext/socket/socket.c (bsock_send): should raise EWOULDBLOCK
  exception.

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

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

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


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-19 07:48:32 +00:00
akr 8e8c76bd5f * lib/time.rb: date.rb is not required anymore.
* lib/resolv.rb: fix document.  refine IPv6 regex.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 18:14:08 +00:00
nobu ab34f43ae8 conflicted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 09:37:34 +00:00
eban b487727ea4 * sample/test.rb: Hash#indexes -> Hash#select.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 08:56:51 +00:00
matz 35f851bcfe * string.c (rb_str_replace): swap arguments of OBJ_INFECT.
* eval.c (rb_thread_schedule): should not select a thread which is
  not yet initialized.

* time.c (time_plus): wrong boundary check.

* time.c (time_minus): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-18 08:47:06 +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
eban 4f8b1c8f64 2001-12-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 07:29:19 +00:00
akr bb6c116c63 * lib/time.rb: use Time#utc_offset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 07:22:03 +00:00
akr b48e38c526 * time.c: new method `gmtoff', `gmt_offset' and `utc_offset'.
(time_utc_offset): new function.
(Init_Time): bind above methods to `time_utc_offset'.

* time.c: 64bit time_t support.
(time_s_at): use NUM2LONG instead of NUM2INT for tv_sec.
(time_arg): initialize tm_isdst correctly.
use long to initialize tm_year.
(search_time_t): renamed from `make_time_t'.
(make_time_t): call `timegm' and `mktime' instead of `search_time_t'
if availabe.
(time_to_i): use LONG2NUM instead of INT2NUM.
(time_localtime): check localtime failure.
(time_gmtime): check gmtime failure.
(time_year): use LONG2NUM instead of INT2FIX.
(time_to_a): use long for tm_year.
(time_dump): check tm_year which is not representable with 17bit.
(time_load): initialize tm_isdst.

* configure.in: check existence of `mktime' and `timegm'.
check existence of tm_gmtoff field of struct tm.
fix negative time_t for 64bit time_t.

* missing/strftime.c: fix overflow by tm_year + 1900.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 06:45:37 +00:00
aamine 39c0252e04 aamine
* lib/net/pop.rb: new method Net::POP3.APOP
* lib/net/http.rb: set default Content-Type to x-www-form-urlencoded (causes warning)
* lib/net/protocol.rb: remove Net::NetPrivate module.
* lib/net/smtp.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/http.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-13 19:15:21 +00:00
matz d8c75ddad3 * time.c (time_new_internal): avoid loop to calculate negative
div, mod.

* time.c (time_cmp): should handle Bignums.

* array.c (rb_ary_pop): should ELTS_SHARED flag check before
  REALLOC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-13 08:19:09 +00:00
matz a59c599209 * string.c (rb_str_match_m): should convert an argument into
regexp if it's a string.

* array.c (rb_ary_select): Array#select(n,m,...) now works like
  Array#indexes(n,m,..). [new, experimental]

* hash.c (rb_hash_select): ditto.

* hash.c (env_select): ditto.

* re.c (match_select): ditto.

* struct.c (rb_struct_select): ditto.

* gc.c (STR_ASSOC): use FL_USER3 instead of FL_USER2.

* parse.y (str_extend): make up pushback call.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-11 03:48:08 +00:00
nobu 8a91c99905 * object.c (rb_class_real): follow included modules.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10 18:21:31 +00:00
usa 8ef5e308e7 * util.h: change prototype of ruby_qsort() to accord with its definition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10 14:43:37 +00:00
eban 55471ed610 * parse.y (gettable): should freeze __FILE__ string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10 10:08:58 +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
keiju 68ed743d99 * matrix.rb: Vector#* bug. reported from Massimiliano Mirra
<info@chromatic-harp.com>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-09 14:11:30 +00:00
nobu ca1a9450fb * enum.c (enum_sort_by): should replace with last elements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-09 13:47:54 +00:00
aamine fa6dc283cd aamine
* lib/net/protocol.rb: calls on_connect before conn_command


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-09 08:58:30 +00:00
aamine a20863ff41 aamine
* lib/net/smtp.rb: SMTP.new requires at least one arg.
* lib/net/pop.rb: POP.new requires at least one arg.
* lib/net/pop.rb: uses "raise *Error.new" instead of simple raise.
* lib/net/http.rb: HTTP.new requires at least one arg.
* lib/net/http.rb: changes implicit start algolithm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-07 10:04:25 +00:00
usa 4ed1344bd7 * ext/extmk.rb.in: ignore adding -Wl,-R to DLDFLAGS when the directory
is $topdir.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-07 06:52:31 +00:00
usa 22d2d65d6f * ext/extmk.rb.in: add -Wl,-R flags to DLDFLAGS on netbsdelf.
* lib/mkmf.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-06 09:55:31 +00:00
matz b3144a7a0e * time.c (time_plus): must detect result overflow.
* time.c (time_minus): ditto.

* time.c (time_new_internal): round usec overflow and underflow
  here.

* time.c (time_plus): move operand overflow/underflow check to
  time_new_internal().

* time.c (time_minus): ditto.

* time.c (time_cmp): should consider tv_usec too.

* time.c (time_gmtime): time_modify() should be called even if tm
  struct is not calculated yet.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-03 10:07:48 +00:00
eban 9e8553e5cc * configure.in: add -Wl,-export-dynamic on NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-03 09:38:35 +00:00
eban f4bef0acfd * ext/socket/extconf.rb: remove -L/usr/local/lib.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-03 07:09:01 +00:00
usa 8abe10b3da * configure.in: not use X11BASE, since it's not always set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-03 07:06:28 +00:00
usa a2ec07f1d1 * configure.in: apply patch from NetBSD's pkgsrc (patch-aa).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-02 18:33:10 +00:00
eban dd17e103f4 * configure.in: use GCC, not without_gcc. remove without_gcc.
* ext/curses/extconf.rb: check for curses.h.
* ext/dbm/extconf.rb: check if $CFLAGS includes DBM_HDR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-02 14:10:27 +00:00
eban 3dfb98cea2 * configure.in: default --enable-shared to yes on cygwin and mingw32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-30 09:21:46 +00:00
eban 3691d88f36 * configure.in: set target_cpu to i386 on cygwin and mingw32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-30 09:17:30 +00:00
matz 23303b8a63 * string.c (rb_str_equal): object with to_str must be treated as a
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-29 15:57:25 +00:00
usa 080aa35bba * README.EXT: Appendix B is duplicated.
* README.EXT.ja: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-29 15:30:54 +00:00
matz 6ab0ff977d * eval.c (rb_thread_select): should subtract timeofday() from
limit, not reverse.

* util.c (scan_hex): x is not a hexadecimal digit.

* eval.c (rb_thread_schedule): should treat the case that
  select(2) returns 0, if a thread is under both WAIT_SELECT and
  WAIT_TIME.  Jakub Travnik <J.Travnik@sh.cvut.cz> actually fixed
  this bug.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-28 14:56:32 +00:00
matz 186c8b592a * marshal.c (w_float): must distinguish -0.0 from 0.0.
* gc.c (gc_mark_all): tweak mark order for little bit better scan.

* gc.c (rb_gc_mark): ditto.

* gc.c (rb_gc): ditto.

* enum.c (sort_by_i): slight performance boost.

* gc.c (gc_mark_rest): should call gc_mark_children(), not gc_mark().

* gc.c (rb_gc_mark): may cause infinite looop.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-27 10:00:35 +00:00
knu 09a4937b2f Import the "syslog" module from the rough ruby project. This module
provides the interface to the UNIX system logger (syslog).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-26 12:00:40 +00:00
usa 43271e97ab * win32/win32.c (mypopen): fixed that mypclose() didn't really close
pipe.

	* win32/win32.c (CreateChild): set STARTF_USESTDHANDLES flag only
	  when some handles are passed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-26 07:59:01 +00:00
usa 412f5709ef * parse.y (str_extend): change types of second and third arguments
from char to int.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-25 12:09:36 +00:00
matz f1fdbf080e * parse.y (str_extend): should check nesting parentheses in #{}.
* process.c (pst_wstopsig): returns nil unless WIFSTOPPED() is
  non-zero.

* process.c (pst_wtermsig): returns nil unless WIFSIGNALED() is
  non-zero.

* process.c (pst_wexitstatus): returns nil unless WIFEXITED() is
  non-zero.

* eval.c (rb_thread_select): tv_sec and tv_usec should not be
  negative.

* signal.c (posix_signal): do not set SA_RESTART for SIGVTALRM.

* parse.y (call_args2): block_arg may follow the first argument in
  call_args2.

* eval.c (stack_check): should avoid stack length check during
  raising SystemStackError exception.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-21 15:42:12 +00:00
shugo e15f65b004 * lib/cgi.rb: CGI#header: do not set Apache.request.status for
Location: if Apache.request.status is already set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-21 03:30:22 +00:00
matz 24b3a3e748 * parse.y (str_extend): should not terminate string interpolation
with newlines in here-docs and newline terminated strings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-19 16:20:24 +00:00
matz 04f27f5e8d * eval.c (rb_mod_modfunc): should follow NODE_ZSUPER link; based
on Guy Decoux's patch in [ruby-talk:25478].

* string.c (rb_str_succ): there was buffer overrun.

* parse.y (str_extend): term can be any character.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-19 14:42:45 +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
wakou d550569264 * lib/cgi.rb (header): support for Apache. thanks to
Shugo Maeda <shugo@ruby-lang.org>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-18 20:08:14 +00:00
nobu 5ca24aa3e8 * parse.y: needless conditionals.
* parse.y (parse_regx): parse error at unterminated regex /#{.
  (ruby-bugs-ja:PR#142)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-18 10:49:28 +00:00
nobu 35008e2087 * array.c (rb_ary_join): non-nil separator must be converted to
String.  and separators' total length was wrong.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-15 15:56:08 +00:00
usa a79f85e6cf * hash.c (ruby_setenv): remove USE_WIN32_RTL_ENV block since it's
obsoleted.

	* win32/win32.c, win32/win32.h: sort out #if 0 - #endif or others.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-14 18:41:46 +00:00
usa d51279d862 * win32/win32.c (waitpid): fix wait count.
* win32/win32.c (poll_child_status): rename from wait_child().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-13 16:14:42 +00:00
eban fffeb61121 * configure.in: do not override CC if set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-13 10:53:20 +00:00
matz 7422ccdd9e * signal.c (sighandle): should not re-register sighandler if
POSIX_SIGNAL is defined.

* eval.c (error_print): errat array may be empty.

* eval.c (rb_eval_cmd): should not upgrade safe level unless
  explicitly specified by argument newly added.

* signal.c (sig_trap): should not allow tainted trap closure.

* variable.c (rb_f_trace_var): should not allow trace_var on safe
  level higher than 3.

* variable.c (rb_f_trace_var): should not allow tainted trace
  closure.

* gc.c: do not use static stack until system stack overflows.

* eval.c (eval): should call Exception#exception instead of
  calling rb_exc_new3() directly.

* error.c (exc_exception): set "mesg" directly to the clone.  it
  might be better to set mesg via some method for flexibility.

* variable.c (cvar_override_check): should print original module
  name, if 'a' is T_ICLASS.

* parse.y (yylex): float '1_.0' should not be allowed.

* variable.c (var_getter): should care about var as Qfalse
  (ruby-bugs#PR199).

* array.c (cmpint): <=> or block for {min,max} may return bignum.

* array.c (sort_1): use rb_compint.

* array.c (sort_2): ditto.

* enum.c (min_ii): ditto.

* enum.c (min_ii): ditto.

* enum.c (max_i): ditto.

* enum.c (max_ii): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-13 08:19:52 +00:00
usa 90ff4f01ab * win32/win32.c (mypopen): return error status instead of calling
rb_sys_fail().

	* win32/win32.c (do_spawn): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-13 07:50:20 +00:00
usa c5ca1bc929 * hash.c (envix): use GET_ENVIRON and FREE_ENVIRON to get environment
variables list.

	* hash.c (env_keys): ditto.

	* hash.c (env_each_key): ditto.

	* hash.c (env_values): ditto.

	* hash.c (env_keys): ditto.

	* hash.c (env_each_value): ditto.

	* hash.c (env_each): ditto.

	* hash.c (env_inspect): ditto.

	* hash.c (env_to_a): ditto.

	* hash.c (env_size): ditto.

	* hash.c (env_empty_p): ditto.

	* hash.c (env_has_value): ditto.

	* hash.c (env_index): ditto.

	* hash.c (env_to_hash): ditto.

	* win32/win32.c (win32_getenv): use static buffer.

	* win32/win32.c, win32/win32.h (win32_get_environ): get environment
	  variables list. [new]

	* win32/win32.c, win32/win32.h (win32_free_environ): free environment
	  variables list. [new]

	* win32/win32.c (do_spawn): use CreateChild() instead of calling
	  CreateProcess() directly. Original patches comes from Patrick Cheng.

	* win32/win32.c (mypopen): ditto.

	* win32/win32.c (mypclose): use rb_syswait() instead of waiting in this
	  function.

	* win32/win32.c (waitpid): use wait_child() instead of _cwait().

	* win32/win32.c (CreateChild): added. [new]

	* win32/win32.c (wait_child): added. [new]

	* win32/win32.c (FindFirstChildSlot): added. [new]

	* win32/win32.c (FindChildSlot): added. [new]

	* win32/win32.c (FindPipedChildSlot): added. [new]

	* win32/win32.c (CloseChildHandle): added. [new]

	* win32/win32.c (FindFreeChildSlot): added. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-13 03:59:20 +00:00
usa 8fed738ffa * win32/config.status.in: make CFLAGS same as Makefile's one.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-09 04:52:54 +00:00
nobu 76204d7a52 * eval.c (rb_trap_eval): avoid annoying warning with signal.
[ruby-talk:23225]

* eval.c (rb_call0): adjust caller source file/line while
  evaluating optional arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-08 12:42:39 +00:00
matz cf4451e8c2 * file.c (path_check_1): forgot to initialize 'p'.
* mkconfig.rb: use String#dump to generate Ruby string literal.

* range.c (range_eql): should override 'eql?'

* array.c (rb_ary_hash): should override 'hash' too.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-08 09:21:59 +00:00
matz ab827130d3 * 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@1815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-07 09:05:08 +00:00
shugo 2fc66e2841 * lib/net/imap.rb (getquota_response): use astring for mailbox
names.
* lib/net/imap.rb (getacl_response): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-06 05:20:25 +00:00
keiju edaf0477a5 * matrix.rb (Matrix#column_vectors, Matrix#row_vectors): ditto bug.
this bug report and fix by tsutomu@nucba.ac.jp.

* forwardable.rb: change raise to Kernel::raise


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-03 13:41:57 +00:00
matz bbb608ad79 * bignum.c (rb_big_aref): idx may be a Bignum.
* numeric.c (fix_aref): negative index must return zero.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-01 05:11:24 +00:00
matz a313c30d9c * gc.c (gc_mark_children): should NOT treat last element of
structs and arrays specially.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-01 04:51:22 +00:00
matz a8c4400d1a * eval.c (exec_under): should initialize ruby_frame->self;
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-31 08:00:18 +00:00
matz c0fe73989d * eval.c (POP_VARS): should not set DVAR_DONT_RECYCLE if _old
ruby_vars is already force_recycled.

* gc.c (rb_gc): handles mark stack overflow.

* gc.c (PUSH_MARK): use static mark stack, no more recursion.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-31 06:53:22 +00:00
wakou 4c9362b74f * lib/cgi.rb: CGI::Cookie::parse(): Ignore duplicate keys caused by
Netscape bug.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-30 17:48:24 +00:00
usa 8d321e3fd4 * win32/mkexports.rb: follow the change of rb_io_puts().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-30 09:23:14 +00:00
matz 54d534f043 * string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'.
* io.c (rb_io_puts): don't treat Array specially.

* bignum.c (rb_big_cmp): should convert bignum to float.

* eval.c (rb_f_eval): can't modify untainted binding.

* regex.c (re_compile_pattern): should preverve p0 value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-30 08:43:28 +00:00
usa 864bc4f18b * intern.h (rb_protect_inspect): follow the change of array.c.
* eval.c (rb_exec_end_proc): follow the change of rb_protect().

	* eval.c (method_proc, umethod_proc, rb_catch): cast the first
	  parameter of rb_iterate() to avoid VC++ warning.

	* range.c (range_step): ditto.

	* ext/sdbm/init.c (fsdbm_update, fsdbm_replace): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-29 06:16:01 +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
nobu 429f7ed113 * eval.c (proc_invoke): fix self switching in Proc#call
(ruby-bugs-ja#PR108) and GC failure.  use Qundef instead of 0
  to direct not switching self.

* eval.c (call_trace_func): ditto.

* eval.c (call_end_proc): ditto.

* eval.c (proc_call): ditto.

* eval.c (proc_yield): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-22 16:28:51 +00:00
nobu 96baf2c092 * variable.c (rb_global_entry): reconstruct global variable
aliasing (sharing global_entry->var with other global_entry).

* variable.c (undef_getter): ditto.

* variable.c (undef_setter): ditto.

* variable.c (val_setter): ditto.

* variable.c (mark_global_entry): ditto.

* variable.c (rb_define_hooked_variable): ditto.

* variable.c (rb_f_trace_var): ditto.

* variable.c (remove_trace): ditto.

* variable.c (rb_f_untrace_var): ditto.

* variable.c (rb_gvar_get): ditto.

* variable.c (trace_en): ditto.

* variable.c (rb_gvar_set): ditto.

* variable.c (rb_gvar_defined): ditto.

* variable.c (rb_alias_variable): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-22 16:20:14 +00:00
matz 959d5febcf * class.c (rb_mod_clone): should not copy class name, since clone
should remain anonymous.

* eval.c (rb_call0): self in a block given to define_method now be
  switched to the receiver of the method.

* eval.c (proc_invoke): added new parameter to allow self
  switching.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-22 06:48:18 +00:00
nobu d0129370f0 * variable.c (remove_trace): should not access already freed area.
* variable.c (rb_f_untrace_var): fix memory leak.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-21 13:22:54 +00:00
nobu eaab0aa79a * marshal.c (w_uclass): cloned class is not user
class. (ruby-bugs-ja#PR103)

* marshal.c (r_object): Struct subclass couldn't
  load. (ruby-bugs-ja#PR104)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-19 14:32:51 +00:00
nobu e725a1a6ab * variable.c (alias_fixup): added. ad hoc support for ordinary
global variable aliasing. when original entry is set, make the
  alias to refer directly as possible.

* variable.c (alias_getter, alias_setter): ditto.

* variable.c (rb_alias_variable): ditto. and no need to mark alias
  variables.

* variable.c (rb_gvar_defined): refer the original entry of an alias.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-17 05:28:02 +00:00
nobu 7d9c2a6733 * eval.c (rb_f_missing): check stack level with rb_stack_check().
* eval.c (rb_call0): ditto.

* eval.c, intern.h (rb_stack_check): added. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-16 15:17:10 +00:00
nobu 1c7cf852bd missing changelog.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-16 05:21:16 +00:00
matz 5f877e8431 * string.c (rb_str_index): wrong increment for non alphanumeric
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-16 03:27:23 +00:00
nobu 093595801f * parse.y (yylex): disallow alpha-numeric and mbchar for
terminator of %string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-15 15:15:45 +00:00
matz 8098dd6c80 * file.c (rb_stat_clone): should copy internal data too.
* numeric.c (num_clone): Numeric should not be copied by clone.

* object.c (rb_obj_clone): should check immediate values.

* parse.y (command): `yield' should take command_args.

* parse.y (parse_quotedwords): %w(...) is not a string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-10 08:21:13 +00:00
matz 9383505c40 * eval.c (rb_eval): NODE_MATCH3 was confusing left and right. sigh.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-09 09:46:42 +00:00
eban 681b54c0bd * process.c (Init_process): activate the case NT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-09 09:42:47 +00:00
nobu 192b82bf4b * eval.c (thread_status_name): separated from
rb_thread_inspect(). return string expression for thread status.

* eval.c (rb_thread_status, rb_thread_inspect): use
  thread_status_name().

* eval.c (rb_thread_priority_set): return the priority not but
  self.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-09 08:19:46 +00:00
matz ef52ffdf61 * marshal.c (w_unique): should not dump anonymous class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-05 06:30:42 +00:00
nobu 809a9c5b6d * eval.c (proc_s_new): revived.
* eval.c (Init_Proc): define Proc.new instead of Proc.allocate to
  inhibit from creating uninitialized Proc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-05 05:49:02 +00:00
matz 3358b44f6e * re.c (rb_reg_s_alloc): avoid inifinte recursion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-04 09:30:13 +00:00
eban ffcdd05412 * ext/socket/socket.c (ruby_connect): EALREADY is the equivalent
for EINPROGRESS in ws2_32.lib.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-04 05:32:09 +00:00
nobu 822f1a5a59 * ext/gdbm/gdbm.c (rb_gdbm_fetch): str is a VALUE now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-03 07:52:09 +00:00
matz 1fe40b7cc5 * marshal.c (r_object): better allocation type check for
TYPE_UCLASS. usage of allocation framework is disabled for now.

* variable.c (rb_class_path): Module may have subclass.

* string.c (rb_str_update): should maintain original negative
  offset.

* string.c (rb_str_subpat_set): ditto

* string.c (rb_str_aset): ditto.

* re.c (rb_reg_nth_match): should check negative nth.

* re.c (rb_reg_nth_defined): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-03 07:19:19 +00:00
eban d902111a57 * lib/ftools.rb (catname): allow trailing '/' for the destination.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-02 10:36:34 +00:00
matz 75eee0bafd * ext/socket/socket.c (unix_addr): getsockname(2) may result len = 0.
* ext/socket/socket.c (unix_peeraddr): getpeername(2) may result
  len = 0.

* string.c (rb_str_subpat_set): support function for new argument
  pattern String#[re,offset] = val. [new]

* eval.c (POP_BLOCK): rb_gc_force_recycle() was called too much.
  Should not be called if SCOPE_DONT_RECYCLE is set.

* string.c (rb_str_aref_m): new argument pattern
  String#[re,offset]. [new]

* string.c (rb_str_substr): should return an instance of
  receiver's class.

* string.c (rb_str_succ): ditto.

* array.c (rb_ary_subseq): ditto.

* array.c (rb_ary_initialize): Array.new([1,2,3]) => [1,2,3]. [new]

* string.c (rb_str_reverse): should return an instance of
  receiver's class.

* string.c (rb_str_times): ditto.

* array.c (rb_ary_times): ditto

* string.c (str_gsub): ditto.

* string.c (rb_str_ljust): ditto.

* string.c (rb_str_rjust): ditto.

* string.c (rb_str_center): ditto.

* eval.c (eval): retrieves file, line information from binding.

* eval.c (intersect_fds): counts intersecting fds.

* eval.c (rb_thread_schedule): only fds requested by
  each thread count as select_value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-02 04:31:23 +00:00
nobu 34a31235c9 * marshal.c (r_object): TYPE_UCLASS check should be inversed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-01 23:28:57 +00:00
ts 810d9fcdbf Wed Sep 26 19:02:39 2001 Guy Decoux <ts@moulon.inra.fr>
* parse.y: allow 'primary[] = arg'


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-26 17:09:47 +00:00
usa 906d9cc83b * win32/win32.c (isInternalCmd): check return value of NtMakeCmdVector (Tietew <tietew@tietew.net>'s patch).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-25 01:47:47 +00:00
nobu a8f1dd8d9f forgotten MATCH_DATA...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-20 12:51:58 +00:00
nobu 9fb8ea1fc7 for special local variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-20 06:25:42 +00:00
matz 6767cd760a * string.c (rb_str_init): String.new() => ""
* dir.c (dir_path): new method.

* dir.c (dir_initialize): wrap DIR into struct, along with path
  information.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-19 06:54:11 +00:00
matz 67245eec71 * eval.c (rb_thread_restore_context): save current value of
lastline and lastmatch in the thread struct for later restore.

* eval.c (rb_thread_save_context): restore lastline and lastmatch.

* numeric.c (flo_to_s): should handle negative float value.

* class.c (rb_include_module): should check whole ancestors to
  avoid duplicate module inclusion.

* string.c (trnext): should check backslash before updating "now"
  position.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-08 14:17:53 +00:00
wakou 1bcc5eb922 * lib/net/telnet.rb: waitfor(): improvement. thanks to
nobu.nakada@nifty.ne.jp


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-07 22:17:13 +00:00
wakou 6e2490beb5 * lib/net/telnet.rb: waitfor(): bug fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-07 00:56:10 +00:00
wakou 749f0f9255 * lib/cgi.rb: CGI#doctype(): bug fix (html4Fr).
* lib/net/telnet.rb, lib/cgi.rb: remove VERSION, RELEASE_DATE,
	  VERSION_CODE, RELEASE_CODE. please use REVISION.

	* lib/cgi.rb: CGI#header(): bug fix.

	* lib/net/telnet.rb, lib/cgi.rb: concat --> +=


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-06 22:18:11 +00:00
nobu aebf069adf * dir.c (dir_s_chdir): raise if environment variable HOME/LOGDIR
not set.

* dir.c (glob_helper): avoid infinite loop on a file name with
  wildcard characters. (ruby-bugs#PR177)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-06 08:48:07 +00:00
knu 970dbfde6f * ext/digest/digest.c (rb_digest_base_s_hexdigest): remove a debug
print.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-06 05:29:27 +00:00
shugo 99ae768645 * ext/readline/readline.c: restore terminal mode
even if readline() interrupted.

* ext/readline/readline.c: returned string need to
  be tainted.

* ext/readline/readline.c: fixed memory leak.

* ext/readline/readline.c: allow negative index.

* ext/readline/readline.c: added Readline::HISTORY.size
  same as Readline::HISTORY.length

* ext/readline/readline.c: allow conditional parsing
  of the ~/.inputrc file by `$if Ruby'.

* ext/readline/extconf.rb: check whether the
  libreadline has the variable `rl_completion_append_character'
  (this feature was implemented from GNU readline 2.1).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-06 05:14:06 +00:00
knu 4c9a9a620a * ext/digest/digest.c (rb_digest_base_s_digest,
rb_digest_base_s_hexdigest): ensure that a string is given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-06 05:02:29 +00:00
eban d878585e5f * lib/jcode.rb (_regexp_quote): fix quote handling, again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-06 04:34:36 +00:00
nobu 0530ceb2b9 * file.c (rb_find_file_ext): add const qualifiers to ext.
* intern.h (rb_find_file_ext): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-05 22:31:07 +00:00
nobu a09435ec20 * ext/socket/socket.c (Init_socket): remove duplicating constants.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-05 22:18:56 +00:00
eban 2a67d0b9f9 * lib/jcode.rb (_regexp_quote): fix quote handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-05 08:45:47 +00:00
matz 2e2786ccab * re.c (Init_Regexp): to_s to be alias to inspect.
* parse.y (yylex): should support 'keyword='.

* ruby.c (proc_options): should not adjust argc/argv if -e option
  is supplied.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-05 06:54:57 +00:00
nobu 393f665e33 * intern.h (rb_find_file_ext): changed from rb_find_file_noext().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-03 11:30:58 +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
knu 50dcbc8cc6 * error.c: unbreak the build on *BSD with gcc 3.0.1 by removing
the conflicting declaration of sys_nerr for *BSD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-03 05:18:02 +00:00
nobu d1ad995dfd * ruby.c (set_arg0): prevent SEGV when val is longer than the
original arguments.

* ruby.c (ruby_process_options): initialize total length of
  original arguments at first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-01 01:25:09 +00:00
matz b47a99485b * parse.y (yylex): ternary ? can be followed by newline.
* eval.c (rb_f_require): should check static linked libraries
  before raising exception.

* array.c (rb_ary_equal): check identiry equality first.

* string.c (rb_str_equal): ditto.

* struct.c (rb_struct_equal): ditto.

* numeric.c (Init_Numeric): undef Integer::new.

* eval.c (rb_eval): NODE_WHILE should update result for each
  conditional evaluation.

* eval.c (rb_eval): NODE_UNTIL should return last evaluated value
  (or value given to break).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-29 06:28:51 +00:00
usa 3a42901a80 * dln.c (dln_strerror): fix a bug that sometimes made null message on
win32 (Tietew <tietew@tietew.net>'s patch).

* win32/win32.c (mystrerror): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-24 05:45:55 +00:00
nobu 4ffb361630 fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-23 17:49:08 +00:00
matz 1289a7a11f * eval.c (is_defined): should not dump core for "defined?(())".
* eval.c (umethod_bind): recv can be an instance of descender of
  oklass if oklass is a Module.

* hash.c (rb_hash_equal): check identiry equality first.

* file.c (group_member): should check real gid only.

* file.c (eaccess): do not cache euid, since effective euid may be
  changed via Process.euid=().

* file.c (eaccess): return -1 unless every specified access mode
  is permitted.

* eval.c (rb_eval): while/until returns the value which is given
  to break.

* parse.y (value_expr): using while/until/class/def as an
  expression is now gives a warning, not an error.

* range.c (range_eqq): should compare strings based on magical
  increment (using String#upto), not dictionary order.

* enum.c (enum_sort_by): new method for Schewartzian transformed
  stable sort.

* variable.c (mod_av_set): detect constant overriding for built-in
  classes/modules.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-23 06:02:15 +00:00
eban e15efe7733 * ext/digest/sha2/extconf.rb: fix support for cross-compiling.
* mkconfig.rb: fix support for autoconf 2.52.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-20 10:56:03 +00:00
matz ba294ad060 * parse.y (tokadd_escape): escaped backslashes too much.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-20 06:15:53 +00:00
matz c786866812 * range.c (range_step): 'iter' here should be an array.
* marshal.c (w_object): should retrieve __member__ data from
  non-singleton class.

* variable.c (rb_cvar_get): class variable override check added.

* variable.c (rb_cvar_set): ditto

* variable.c (rb_cvar_declare): ditto.

* parse.y (parse_regx): handle backslash escaping of delimiter here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-20 04:29:58 +00:00
aamine 772ed5507e aamine
* lib/net/protocol.rb: Protocol.new requires at least one arg.
* lib/net/smtp.rb: ditto.
* lib/net/pop.rb: ditto.
* lib/net/http.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-17 03:08:45 +00:00
usa 9ba7324ceb * ext/socket/socket.c (s_recvfrom): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-16 04:54:31 +00:00
usa 429ad453f8 * ext/socket/socket.c (s_recvform): avoid VC++6 warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-16 00:54:54 +00:00
usa e5de410caf * win32/win32.c (NtCmdGlob): avoid VC++ warning.
* lib/mkmf.rb: add -I$(srcdir) to CPPFLAGS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-15 18:51:58 +00:00
knu 6ce3130067 * ext/digest/*/extconf.rb: really fix so that they build from any
directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-14 20:05:21 +00:00
knu ad4c17c021 * ext/digest/sha2/extconf.rb: fix so that they build from any
directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-14 19:05:37 +00:00
knu 6a581e6317 * ext/digest/defs.h: Define NO_UINT64_T instead of emitting an
error to fail.

* ext/digest/sha2/extconf.rb: Do not exit on error, and utilize
  NO_UINT64_T to detect if the system has a 64bit integer type.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-14 17:04:00 +00:00
knu 5b63fc556f * ext/digest/sha2/extconf.rb: do not create Makefile when no 64bit
integer type is detected.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-14 12:15:21 +00:00
matz 04a8e85bc5 * range.c (range_step): new method.
* string.c (rb_str_cmp): remove needless conditional.

* string.c (rb_str_lstrip_bang) `return Qnil' was missing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-14 08:13:31 +00:00
knu 62bf905d4e * bignum.c, marshal.c: Detypo: s/SIZEOF_ING/SIZEOF_INT/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-13 05:17:38 +00:00
nobu 7e97ab23f8 * string.c (rb_str_cat): fix buffer overflow.
* string.c (rb_str_append): nothing to append actually when `str2'
  is empty.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-12 09:41:39 +00:00
usa dfaaa55199 * win32/win32.h: fix problems with BC++ (ruby-bugs#PR161).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-07 00:21:40 +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
usa 2270c16ff9 * numeric.c (num_divmod): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-06 05:33:17 +00:00
matz 14cd947317 * struct.c (rb_struct_modify): should check frozen and taint
status.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-06 03:08:57 +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
nobu 439b453e3a * file.c (strrdirsep): removed meaningless code.
* file.c (rb_file_s_expand_path): return to 1.66.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-01 16:49:11 +00:00
usa cc6d8c466c * eval.c (ruby_run): avoid VC++ warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-01 06:45:13 +00:00
usa 30637ef7e9 * marshal.c (Init_marshal): fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-31 08:33:17 +00:00
nobu 4b7c92fa90 * process.c (last_status_set): nothing returned, should be void.
* ext/socket/socket.c (load_addr_info): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-31 08:04:13 +00:00
matz c8a7361e45 * marshal.c (Init_marshal): new constant Marshal::MAJOR_VERSION
and Marshal::MINOR_VERSION.

* marshal.c (marshal_load): ruby_verbose test should be wrapped by
  RTEST().

* hash.c (rb_hash_index): should return nil (not the default
  value) if value is not in the hash.

* numeric.c (num_div): new method added.  alias to '/' which
  should be preserved even if '/' is redefined (e.g. by
  mathn). [new]

* bignum.c (rb_cstr2inum): "0 ff".hex should return 0, not 255.

* file.c (rb_file_s_expand_path): fixed using CharNext().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-31 06:24:45 +00:00
nobu 645170199c * file.c (rb_file_s_expand_path): scans per path element not per
byte/character, including fix of [ruby-talk:18152] and
  multi-byte pathname support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-30 22:41:59 +00:00
shugo 67d433a5e6 * lib/net/imap.rb: added new commands for managing folder quotas
and folder ACLs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-30 02:15:13 +00:00
matz 0abedcd807 * eval.c (rb_provided): extension should be guessed using
rb_find_file_noext().

* eval.c (rb_f_require): should call rb_feature_p() after
  extension completion.

* eval.c (rb_eval): add CHECK_INTS before next, redo, retry to
  avoid potential uninterruptable infinite loop.

* file.c (rb_file_s_expand_path): use CharNext() to expand.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-27 09:12:12 +00:00
eban f30288ebf6 * file.c (rb_find_file_noext, rb_find_file): fix tilde expansion
problem.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-26 03:54:48 +00:00
knu eb0f1ab783 * intern.h: add some missing function prototypes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-25 08:19:49 +00:00
nobu 4a74d867af * file.c (strrdirsep): multi-byte pathname and DOSish separater
supprot. originally comes from Patrick Cheng. [new]

* file.c (rb_file_s_basename, rb_file_s_dirname): use
  strrdirsep(). comes from Patrick Cheng.

* file.c (is_absolute_path): restricted in DOSish absolute path
  with drive letter, and UNC support. originally comes from
  Patrick Cheng.

* file.c (getcwd): define macro using getwd() unless provided.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-24 15:11:02 +00:00
knu e54216b740 * ext/extmk.rb.in, lib/mkmf.rb: dig the target subdirectory for
lib/* files properly in case of create_makefile("dir/name").


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-24 10:29:17 +00:00
matz 15ffbb1f82 * eval.c (rb_provide_feature): should not tweak extension used for
loading.

* io.c (io_fread): use fread(3) if PENDING_COUND is available.

* class.c (rb_mod_include_p): Module#include? added. [new]

* re.c (ignorecase_setter): give warning on modifying $=.

* string.c (rb_str_casecmp): new method. [new]

* string.c (rb_str_eql): separated from rb_str_equal(), make it
  always be case sensitive. [new]

* string.c (rb_str_hash): made it always be case sensitive.

* eval.c (rb_f_require): should not include path in $" value

* file.c (rb_find_file): should return 0 explicitly on failure.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-24 09:07:33 +00:00
knu 9e214f30c4 * ext/extmk.rb.in, lib/mkmf.rb: introduce a couple of new make
variables: CLEANFILES and DISTCLEANFILES.  They'd typically be
  defined in a file "depend".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-22 12:24:12 +00:00
knu 33c679ba9a * gc.c (ruby_xrealloc): fix a dangling bug which led memory
reallocation to fail even though the second try after a GC
  succeeds.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-20 15:20:25 +00:00
usa 2d84b42b00 * ruby.h: enable volatile directive with VC++.
* regex.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-19 02:46:28 +00:00
aamine 2812249141 date-time was wrong.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-18 20:59:03 +00:00
aamine b84329fb53 add doc/net/http.rd.ja pop.rd.ja smtp.rd.ja
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-18 20:45:55 +00:00
matz f35971afdf * regex.c (NUM_FAILURE_ITEMS): was confusing NUM_REG_ITEMS and
NUM_NONREG_ITEMS, which have happened to be same value.

* class.c (rb_class_new): subclass check moved to this function.

* class.c (rb_class_boot): check less version of rb_class_new().

* eval.c (proc_invoke): should preserve iter status for embedded
  frame in the block.

* file.c (rb_file_s_expand_path): may overrun buffer on stack.

* string.c (rb_str_insert): forgot to call rb_str_modify().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-18 05:56:05 +00:00
aamine c068201c50 modify check-in miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-17 05:25:15 +00:00
usa 9078b69592 * ext/extmk.rb.in: modify RM macro because command.com/cmd.exe don't
recognize single quotation as quote character.

* lib/mkmf.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-17 02:13:13 +00:00
usa affcf615dc * file.c (file_load_ok): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-16 04:22:46 +00:00
matz 03d1c9cd82 * regex.c (re_search): should consider reverse search.
* dir.c (dir_s_chdir): warn only when invoked from multiple
  threads or block is not given.

* object.c (rb_convert_type): should use rb_rescue(), not rb_rescue2().

* range.c (range_init): ditto.

* object.c (rb_obj_dup): should free generic_ivar if original owns
  them.

* string.c (rb_str_each_line): should propagate taint mark.

* ext/nkf/nkf.c (rb_nkf_kconv): ditto.

* eval.c (rb_f_require): revamp for simpler implementation.

* file.c (rb_find_file_noext): use String object, instead of
  passing char* around.

* file.c (rb_find_file): ditto.

* dln.c (dln_load): should use NSLINKMODULE_OPTION_BINDNOW.

* ruby.c (load_file): local variables 'c' remain uninitialized on
  xflag.

* regex.c (re_match): prefetched escaped character too early.

* eval.c (rb_call0): add argument check for attr_readers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-14 15:17:19 +00:00
knu f4b516777b * ext/digest/*/extconf.rb: fix so that they build from any
directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-14 03:29:50 +00:00
aamine a2193f50e8 aamine
* lib/net/http.rb: HTTP#proxy? did not worked.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-13 21:20:41 +00:00
knu 6ecd6fe37b * ext/extmk.rb.in: support multi-level ext/ directories.
(e.g. you can have ext/foo, ext/foo/bar and ext/foo/baz)

* ext/.cvsignore: let cvs ignore extinit.c.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-13 18:02:10 +00:00
knu c0a9b71aeb * lib/mkmf.rb: use File::split to split a target into a prefix and
a module name.  This also works around a just found bug of
  String#rindex.

* ext/extmk.rb.in: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-13 14:19:28 +00:00
eban 18efb38b21 * ext/socket/socket.c (ruby_connect): workaround for the setup of
Cygwin socket(EALREADY).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-12 06:16:49 +00:00
eban f1b3c51701 * lib/mkmf.rb: modify RM macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-09 08:10:26 +00:00
eban 4d134d47d6 * ext/extmk.rb.in: modify RM macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-09 07:54:49 +00:00
knu e45f8f9943 * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-08 11:54:55 +00:00
aamine 2b67bb576a aamine
* lib/net/http.rb: rename HTTP#request_by_name to send_request.
* lib/net/protocol.rb (ProtoSocket#read): modify typo.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-08 07:00:23 +00:00
knu 7f326a3988 * lib/tempfile.rb: a tempfile must be created with mode 0600.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-05 17:19:28 +00:00
aamine afb3a0cff1 aamine
* lib/net/http.rb (HTTP#request_by_name): arg order changes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 19:18:17 +00:00
aamine 9e79454b3d aamine
* lib/net/http.rb (HTTP#request_by_name): bug fix.
* lib/net/http.rb: does not write Connection: by default.
* lib/net/protocol.rb: "start" for started protocol is an error.
* lib/net/protocol.rb: "finish" for finished protocol is an error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 19:03:16 +00:00
aamine fa20d931bc aamine
* lib/net/http.rb: new method HTTP#request_by_name (test)
* lib/net/http.rb: new class HTTPGenericRequest


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 18:13:13 +00:00
knu fc1f22d5a8 * lib/mkmf.rb: distclean should remove mkmf.log as well.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 15:02:20 +00:00
matz f7ac4f227d * eval.c (rb_eval_string_wrap): should push frame (and adjust
cbase) before wrapped eval.

* eval.c (rb_eval_cmd): ditto.

* eval.c (eval): should update ruby_class always after all.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 09:37:08 +00:00
matz 08eef47e5b credit rb_name_error() fix to Nobuyoshi Nakada.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 07:29:00 +00:00
shugo 604a8f1883 * eval.c (block_pass): do not change wrapper information.
* eval.c (rb_yield_0):  preserve wrapper information.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 05:57:16 +00:00
shugo 066cfdc133 * error.c (rb_name_error): raise NameError instead of LoadError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-03 05:52:20 +00:00
matz ffe1cf575e * error.c (exc_exception): clone the receiver exception instead of
creating brand new exception object of the receiver.

* eval.c (rb_eval_string_wrap): extend new ruby_top_self, not
  original self.

* eval.c (rb_eval_cmd): respect ruby_wrapper if set.

* eval.c (eval): do not update ruby_class unless scope is not
  provided.

* eval.c (eval): preserve wrapper information.

* eval.c (proc_invoke): ditto.

* eval.c (block_pass): ditto.

* parse.y (void_expr): too much warnings for void context
  (e.g. foo[1] that can be mere Proc call).

* error.c (rb_name_error): new function to raise NameError with
  name attribute set.

* eval.c (rb_f_missing): set name and args in the exception
  object. [new]

* error.c (name_name): NameError#name - new method.

* error.c (nometh_args): NoMethodError#args - new method.

* lex.c (rb_reserved_word): lex_state after tRESCUE should be
  EXPR_MID.

* gc.c (add_heap): allocation size of the heap unit is doubled for
  each allocation.

* dir.c (isdelim): space, tab, and newline are no longer
  delimiters for glob patterns.

* eval.c (svalue_to_avalue): new conversion scheme between single
  value and array values.

* eval.c (avalue_to_svalue): ditto.

* eval.c (rb_eval): REXPAND now uses avalue_to_svalue(), return
  and yield too.

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

* eval.c (proc_invoke): Proc#call gives avaules, whereas
  Proc#yield gives mvalues.

* eval.c (bmcall): convert given value (svalue) to avalue.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-02 08:46:28 +00:00
keiju cc13bb43bc * lib/matrix.rb: resolve 'ruby -w' warnings.
* lib/irb/locale.rb: resolve 'ruby -w' warnings.
* lib/irb/multi-irb.rb: resolve 'ruby -w' warnings.
* lib/irb/ruby-lex.rb: fix problem for "\\M-\\..." and "\\C-\\..."
  and resolve 'ruby -w' warnings.
* lib/irb/ruby-token.rb: fix typo
* lib/shell/command-processor.rb: resolve 'ruby -w' warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-27 15:35:04 +00:00
aamine 37b3f674a7 sorry, check in miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-26 23:51:16 +00:00
aamine c664027a34 aamine
* lib/net/pop.rb: new methods POP3.auth_only, POP3#auth_only
* lib/net/http.rb: HTTP.Proxy returns self if ADDRESS is nil.
* lib/net/protocol.rb: new method ProtocolError#response
* lib/net/protocol.rb,smtp.rb,pop.rb,http.rb: add document.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-26 23:49:21 +00:00
knu c0648ecc85 * ext/readline/readline.c (readline_event): a non-void function
should return a value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-23 09:30:42 +00:00
eban 2cf4fce053 * ext/socket/socket.c (ruby_connect): workaround for the setup of
Cygwin socket.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-22 14:44:44 +00:00
keiju cdabb04b44 * lib/irb/locale.rb: fix for require "kconv" problem
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-22 14:16:25 +00:00
matz def42c9a0c * eval.c (rb_yield_0): no mvalue_to_svalue conversion here.
* eval.c (massign): takes svalue, convert it to mvalue inside.

* eval.c (rb_eval): parameters for yield/return are always
  svalues now.

* eval.c (svalue_to_mvalue): more strict conversion.

* eval.c (mvalue_to_svalue): ditto.

* st.c (new_size): prime hash size enabled.

* ext/socket/socket.c (Init_socket): SO_* constants added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-22 09:12:24 +00:00
eban ef8e0b4dff * gc.c (rb_setjmp): avoid GCC 3.0 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-19 15:42:00 +00:00
knu 0c92a85e6a * ext/readline/readline.c: add new methods:
Readline::completion_append_character and
  Readline::completion_append_character=.k


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-19 09:21:38 +00:00
matz 058888bd38 * eval.c (svalue_to_mvalue): new function to convert from svalue
to mvalue. [experimental]

* eval.c (mvalue_to_svalue): new function to convert from mvalue
  to svalue.

* eval.c (rb_eval): use mvalue_to_svalue().

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

* eval.c (proc_invoke): proper mvalue handling.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-19 07:33:10 +00:00
matz 9d51cf8a6a * eval.c (rb_f_require): searches ".rb" and ".so" at the same
time.  previous behavior (search ".rb", then ".so") has a
  security risk (ruby-bugs#PR140).

* array.c (rb_ary_to_ary): new function to replace internal
  rb_Array(), which never calls to_a, but to_ary (rb_Array() might
  call both). [new]

* regex.c (PUSH_FAILURE_POINT): push option status again.

* regex.c (re_compile_pattern): avoid pushing unnecessary
  option_set.

* eval.c (rb_load): tainted string is OK if wrapped *and*
  $SAFE >= 4.

* eval.c (rb_thread_start_0): should not nail down higher blocks
  before preserving original context (i.e. should not alter
  original context).

* eval.c (proc_yield): new method equivalent to Proc#call but no
  check for number of arguments. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-19 04:35:17 +00:00
knu 6aa71d4c80 * dir.c (Init_Dir): add a new method File::fnmatch? along with
File::Constants::FNM_*.  While I am here, FNM_NOCASE is renamed
  to FNM_CASEFOLD which is commonly used by *BSD and GNU libc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-13 10:51:39 +00:00
matz 39fb2a27ab * eval.c (method_eq): new method Method#==. [new]
* gc.c (STR_NO_ORIG): STR_NO_ORIG value was different between
  string.c and gc.c

* eval.c (rb_eval): should convert *non-array at the end of
  arguments by using Array().

* hash.c (ruby_setenv): readline library leaves their environment
  strings uncopied.  "free" check revised.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-12 05:31:47 +00:00
knu 83b2db9ea7 * lib/mkmf.rb: target_prefix is only for installation, not for
build.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-12 05:25:04 +00:00
eban c88531e4b9 * confgure.in: add RUBY_CANONICAL_BUILD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-11 05:31:17 +00:00
usa a5c0e5a382 * ext/extmk.rb.in: Use -F and -T for mswin32 because cl.exe doesn't support -o officially and cl.exe considers that *.cc and *.cxx are OBJs.
* lib/mkmf.rb: ditto.

* win32/Makefile.sub: Use del instead of rm. All these changes are derived from Nobuyoshi Nakada's patch. Thanks.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-09 07:41:44 +00:00
matz 46e8ae1104 * gc.c (Init_stack): avoid __builtin_frame_address(2) to retrieve
stack bottom line.

* st.c (numhash): should shuffle bits by dividing by prime number.

* eval.c (rb_eval): multiple assignment behavior fixed, which
  results "*a = nil" makes "a == []" now.

* eval.c (rb_f_require): should set SCOPE_PUBLIC before calling
  dln_load().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-08 14:20:58 +00:00
matz 4c6b76c1e4 * parse.y (yylex): exclude kDO_BLOCK too much by false condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-07 08:29:59 +00:00
keiju 85d105cf8c * lib/sync.rb: bug fix if obj.initialize has parameters when
obj.extend(Sync_m)

* lib/mutex_m.rb: modified bit


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-06 14:19:33 +00:00
matz f0ccffd530 * eval.c (rb_load): should check if tainted even when wrap is
specified.

* regex.c (re_compile_pattern): too much optimization for the
  cases like /(.|a)b/.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-06 07:40:31 +00:00
matz 7c9c33e9ad * parse.y (aref_args): "*arg" should always be expanded by REXPAND.
* variable.c (fc_i): removed vast string allocation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-06 06:42:23 +00:00
matz b12904e85f * error.c (Init_Exception): NameError went under StandardError,
and NoMethodError went under NameError.

* parse.y (rb_intern): non identifier symbols should be
  categorized as ID_JUNK. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-05 07:50:59 +00:00
matz d6c60dbf6d * variable.c (rb_mod_const_at): use hash table as internal
data. [new]

* variable.c (rb_mod_const_of): ditto.

* variable.c (rb_const_list): new function to convert internal
  data (hash table) to array of strings.

* eval.c (rb_mod_s_constants): data handling scheme has changed.

* eval.c (rb_add_method): should not call rb_secure(), for
  last_func may not be set.

* io.c (rb_io_ctl): ioctl should accept any integer within C long
  range.

* marshal.c (r_object): wrong type check for modules.

* marshal.c (w_object): should not dump anonymous classes/modules.

* io.c (rb_open_file): use rb_file_sysopen_internal() if the 3rd
  argument (permission flags) is given. [new, should be backported?]

* io.c (rb_io_mode_binmode): mode string (e.g. "r+") to flags to
  open(2).

* eval.c (rb_eval): NODE_REXPAND expand an array of 1 element as
  the element itself. [new, should be backported?]

* parse.y (ret_args): should treat "*[a]" in rhs expression as
  "a", not "[a]".

* regex.c (re_compile_pattern): should push option modifier at the
  right place.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-05 07:19:39 +00:00
eban ac376af4f4 * ext/etc/extconf.rb: use egrep_cpp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-05 04:43:17 +00:00
wakou bfd441db8f * lib/shellwords.rb: don't destroy argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-03 19:25:07 +00:00
shugo 7dc25230be * lib/cgi/session.rb: don't use module_function for Class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-02 14:19:37 +00:00
keiju 3c024ba5e2 * irb messages: fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-01 15:26:47 +00:00
matz 23f89a8932 * hash.c (replace_i): ignore when key == Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-01 09:38:30 +00:00
matz da548b67f5 * parse.y (call_args2): confusion with list_append() and
list_concat() was fixed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-01 07:52:34 +00:00
matz 353650e6b4 * parse.y (yylex): fixed 'print CGI::bar() {}, "\n"' syntax
breakage, adding new lex_state status.  sigh. [new]

* file.c (rb_file_s_unlink): should not allow if $SAFE >= 2.

* range.c (Init_Range): define "to_ary".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-01 06:47:32 +00:00
eban e8fb16c70f * configure.in: use waitpid on mingw32.
* ext/dbm/extconf.rb: include <ndbm.h>, not <gdbm.h>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-06-01 02:25:28 +00:00
eban ac41cd6844 * mkconfig.rb, ext/configsub.rb: VERSION -> RUBY_VERSION.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-31 04:40:37 +00:00
usa a0047c7d89 * win32/dir.h: re-add.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-30 23:02:54 +00:00
knu 2c537562df * configure.in: default --with-libc_r to `no' until the problem is
fixed. (FreeBSD only)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-05-30 16:29:32 +00:00