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

704 Коммитов

Автор SHA1 Сообщение Дата
eban a0bf3b3bb9 * configure.in (solaris): add '-shared' only for GNU ld.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-25 09:00:50 +00:00
matz f547c1150c * class.c (rb_include_module): detect cyclic module inclusion.
* eval.c (rb_thread_cleanup): need not to free thread stacks at
  process termination.

* array.c (rb_ary_fetch): use the block to get the default value
  if the block is given.

* eval.c (rb_thread_schedule): should check time only if BOTH
  WAIT_SELECT and WAIT_TIME.

* eval.c (umethod_bind): should update rklass field.

* hash.c (rb_hash_update): if a block is given, yields [key,
  value1, value2] to the block to resolve conflict.

* string.c (rb_str_split_m): no need to consider KANJI
characters, if the length of separator is 1 (byte).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-25 08:22:11 +00:00
matz eb9708f386 * array.c (Init_Array): remove Array#filter.
* object.c (rb_mod_initialize): should accept zero argument.

* object.c (rb_mod_cmp): should raise ArgumentError if
  inheritance/inclusion relation between two classes/modules is
  not defined. [new]

* io.c (rb_io_fsync): new method. [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23 07:30:43 +00:00
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