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

672 Коммитов

Автор SHA1 Сообщение Дата
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