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

2412 Коммитов

Автор SHA1 Сообщение Дата
matz 70cf909fdd * ext/bigdecimal/bigdecimal.c (BigDecimal_truncate): return
integer if no optional argument given. [incompatible]

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

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 16:46:48 +00:00
matz 57f7d8c2cd * ext/openssl/ossl_ssl.c (ossl_ssl_read_nonblock):
OpenSSL::SSL::SSLSocket should implement read_nonblock.  a patch
  from Aaron Patterson in [ruby-core:20277].  fix: #814 [ruby-core:20241]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 07:21:10 +00:00
matz f5332d6b5e * ext/curses/curses.c (curses_getch): no ISPRINT(). [ruby-core:20294]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 05:52:30 +00:00
matz 782576a519 * ext/curses/curses.c (window_getch): avoid ISPRINT() macro which
has an issue with OpenSolaris.  [ruby-core:20189]

* signal.c (ruby_signal): EINVAL from sigaction(2) is not a bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 04:57:58 +00:00
nagai 694fab958c * ext/tk/lib/tk/menu.rb: TkOptionMenubutton.new fails to treat
'parent' and 'variable' options on a Hash argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 21:03:49 +00:00
nagai 57746bb6fa * ext/tk/lib/tk.rb: bug fix. use ::RubyVM instead of ::VM [ruby-list:45676]
* ext/tk/tcltklib.c: update RELEASE_DATE


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 20:10:28 +00:00
nobu 13424f32fe * ext/tk/tcltklib.c (ip_ruby_cmd, ip_invoke_with_position): must
not access internal union directly.  [ruby-list:45670]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 05:48:55 +00:00
nobu aa39c4491a * io.c (rb_io_getc, rb_io_readchar): documentation correction from
Emiel van de Laar.  [ruby-core:20212]

* ext/stringio/stringio.c (strio_ungetbyte): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 03:22:12 +00:00
mame 0646c1e0d6 * ext/pty/pty.c (Init_pty): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02 17:05:46 +00:00
matz 23e6fc744e * ext/socket/socket.c (sock_getaddrinfo): should have updated for
Mac OS X.  a patch from Shumpei Akai in [ruby-dev:37234]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-29 09:30:46 +00:00
matz 46e431e3eb * ext/socket/socket.c (sock_s_getaddrinfo): refactored to remove
code duplication regarding getaddrinfo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-28 09:32:20 +00:00
matz 4d3f3af836 * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): bigdecimal
division (including modulo) should raise ZeroDivisionError as
  integer division. [incompatible]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 17:20:08 +00:00
matz 5337b9b5f6 * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should return
Integer for #div operation.

* ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should raise
  ZeroDivisionError if divisor is zero.  [ruby-dev:37207]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 01:43:14 +00:00
matz 0434b0f098 * ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zero
division should raise FloatDomainError if mode
  VP_EXCEPTION_ZERODIVIDE is set.  [ruby-dev:37204]

* ext/bigdecimal/bigdecimal.c (BigDecimal_mode): should handle
  VP_EXCEPTION_ZERODIVIDE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-26 14:04:58 +00:00
kazu 27e3cc841c * ext/gdbm/gdbm.c (rb_gdbm_nextkey): fix memory leak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-26 06:39:14 +00:00
matz 93283e7552 * ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): raise exception
for nan/inf conversion.  [ruby-dev:37187] fix #793

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 18:19:07 +00:00
matz a426373520 * ext/bigdecimal/bigdecimal.c (VpAlloc): avoid ALLOCA_N() to avoid
segmentation fault caused by (insanely) long decimal values.
  [ruby-dev:37189] fix #794

* ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_to_i,
  BigDecimal_to_f, BigDecimal_to_s, BigDecimal_split,
  BigDecimal_inspect): ditto.

* ext/bigdecimal/bigdecimal.c (VpToString): small performance
  improvement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-25 18:02:42 +00:00
nagai 9a206a8039 * ext/tk/lib/tkextlib/blt/tabset.rb, ext/tk/lib/tkextlib/blt/tabnotebook.rb:
fix many bugs. Now, those work properly.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 18:49:43 +00:00
nagai 89f1118329 * ext/tk/lib/tkextlib/version.rb, ext/tk/ChangeLog.tkextlib: update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-22 01:43:31 +00:00
nagai 2e1ee398a4 * ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb:
fix NameError bug.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-22 01:37:58 +00:00
matz 1e1d2b2639 * ext/pty/pty.c (get_device_once): abandon asynchronous exception
that might cause serious problem if a program terminated early.
  asynchronous exception is a very bad thing anyway.  use
  Process.waitpid(pid) or PTY.check(pid) to poll program
  termination. if PTY.check is called with optional second
  argument being true, it raises an exception same as one from
  previous behavior.  [incompatible] fix: [ruby-core:19583]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-21 18:45:01 +00:00
matz 137b5ecd8d * ext/curses/curses.c (curses_escdelay_set): support ESCDELAY. a
patch from Giancarlo F Bellido <support@coaxialhost.com> in
  [ruby-core:19961].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-21 18:35:11 +00:00
matz d37f45cef9 * ext/syck/rubyext.c (rb_syck_mktime): return DateTime for a value
out of range of Time.   [ruby-core:19919]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-19 08:49:51 +00:00
matz e644398bc6 * ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): moved from
bigdecimal/util, converted into C.  [ruby-dev:36805]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 10:45:21 +00:00
matz 75fcee4a23 * ext/stringio/stringio.c (strio_ungetc): ungetc position should
not be changed from 1.8.   [ruby-core:19632]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08 08:32:55 +00:00
matz 703fb3d9be * ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash.
[ruby-dev:37039]

* ext/sdbm/init.c (Init_sdbm): typo fixed.  [ruby-dev:37039]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08 03:15:28 +00:00
matz c82769f227 * ext/dbm/dbm.c (fdbm_index): make #index warn like Hash.
* ext/dbm/dbm.c (fdbm_key): new method.

* ext/sdbm/init.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07 22:07:05 +00:00
matz 80d16e7403 * ext/curses/curses.c: curses encoding should obey locale.
* ext/curses/curses.c (curses_getch): 1.9 getch should return one
  character string for single byte string.  wchar_t support may
  follow in the future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07 21:42:24 +00:00
naruse 10ddffb278 * nkf.c: update to r1.188. fixes for 16bit environment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07 02:59:38 +00:00
suke 696e6a9b76 * ext/win32ole/win32ole.c (fole_s_connect, fole_initialize,
folevariant_initialize): check argument type of WIN32OLE.connect,
  WIN32OLE.new, WIN32OLE_VARIANT.new.

* test/win32ole/test_win32ole.rb (test_s_new_exc, test_s_connect_exc):
  ditto.

* test/win32ole/test_win32ole_variant.rb (test_s_new_exc): ditto.

* test/win32ole/test_win32ole_method.rb: add assertion of
  WIN32OLE_METHOD.new.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-06 12:38:49 +00:00
suke 2d45869c76 * ext/win32ole/win32ole.c (ole_event_free): invoke IConnectionPoint::Unadvise
before invoking IConnectionPoint::Release.

* test/win32ole/test_win32ole_event.rb, test/win32ole/err_in_callback.rb,
  test/win32ole/test_err_in_callback.rb: Use ActiveX Data Object
  Library instead of InternetExplorer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-02 13:22:42 +00:00
nobu 388abb698c * ext/zlib/zlib.c (Init_zlib): defines readbyte instead redefining
readchar.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-02 07:41:56 +00:00
naruse b87182fa7f * ext/nkf/nkf-utf8/nkf.c (kanji_convert): output unicode chars.
[ruby-dev:36957]

* ext/nkf/nkf-utf8/nkf.c (numchar_getc): increase buffer size.
  reported and patched at [ruby-dev:36957] by mame.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 14:30:17 +00:00
tadf 2b72e549a7 * complex.c: continues to support canonicalization *unofficially*
for an odd library mathn for the time being (only 1.9.x).
	  since grand mathn is must be very very special library for us.

	* rational.c: ditto.

	* ext/mathn/*/*: follow the above changes.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 14:11:08 +00:00
usa 46f8afdc56 * ext/mathn/complex/complex.c: no need to define rb_cComplex because
it's already defined at $(srcdir)/complex.c.

	* ext/mathn/rational/rational.c: no need to define rb_cRational because
	  it's already defined at $(srcdir)/rational.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-27 11:07:37 +00:00
kazu 4e0b83e95b * ext/nkf/nkf.c (rb_nkf_convert): should specify type of variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-27 03:04:22 +00:00
naruse f850cf2866 * ext/nkf/nkf.c (rb_nkf_convert): avoid GC.
reported in [ruby-dev:36909] and patched [ruby-dev:36941] by mame.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26 16:08:03 +00:00
nobu bcf61f58d5 * ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on
cygwin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26 09:11:40 +00:00
nobu 201eb37d92 * ext/etc/etc.c (sGroup): getgrent may not be available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26 09:07:37 +00:00
matz 0ad553ce58 * ext/mathn/rational/rational.c: undef duplicated macro definition
first to shut up the warning.

* ext/mathn/rational/rational.c (rb_rational_new_mathn): specify
  omitted return value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-24 16:30:09 +00:00
keiju f953305ff5 * ext/mathn/rational.c: change several global functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-24 12:20:58 +00:00
keiju 7e8ab850b0 * ext/mathn/rational.c: change several global functions to static
function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-24 11:47:59 +00:00
keiju 4f817e2a9d * lib/mathn.rb: moved into ext/mathn/rational/rational.c and
ext/mathn/complex/complex.c.
 * ext/mathn: new mathn ext-libralies.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-24 09:39:53 +00:00
nobu 409293eb09 * ext/socket/socket.c (sock_s_getservbyport): check if the port range.
[ruby-core:19460]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 07:16:20 +00:00
nobu 472156c236 * ext/socket/socket.c (sock_s_getservbyname): unuse unnecessary
object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 05:08:10 +00:00
nobu a5ea0e8c32 * ext/socket/socket.c (sock_s_getservbyport): the port should be
converted before the proto so that the #to_int of the former cannot
  alter the latter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 02:18:00 +00:00
usa 538d87cf11 * ext/socket/socket.c (sock_s_getservbyport): cast to get rid of
warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 00:27:52 +00:00
matz c1bb485ca0 * ext/socket/socket.c (sock_s_getservbyport): port should be
network byte order.  a patch from Dave Thomas in [ruby-core:19454].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-22 23:12:02 +00:00
matz 38c7a687e1 * string.c (rb_str_conv_enc_opts): new function to convert with
specifying ecflags and ecopts.

* ext/zlib/zlib.c (gzfile_newstr): specify ecflags and ecopts for
  conversion using above function.

* ext/zlib/zlib.c (gzfile_newstr): use own rb_econv_t for dummy
  encoding to handling stateful encoding (e.g. iso-2022-jp).
  [ruby-dev:36857]

* ext/zlib/zlib.c (gzfile_getc): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-22 16:53:50 +00:00
matz 4a3f2a7bc5 * string.c (rb_external_str_new_with_enc): no implicit strlen call.
[ruby-dev:36854]

* string.c (rb_external_str_new_cstr): new function to create
  string from external NUL terminated C string.

* string.c (rb_locale_str_new_cstr): ditto.

* ext/readline/readline.c: now use rb_locale_str_new_cstr().

* test/sdbm/test_sdbm.rb (TestSDBM#test_delete_with_block):
  deleted key to the block may be a copy of specified key.

* test/dbm/test_dbm.rb (TestDBM#test_delete_with_block): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-22 05:55:22 +00:00