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

3877 Коммитов

Автор SHA1 Сообщение Дата
mrkn 5edd7f07d8 * ext/bigdecimal/bigdecimal.c (BigDecimal_version): version 1.1.0.
* ext/bigdecimal/bigdecimal.gemspec: turn into a default gem.
* tool/rbinstall.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30 05:31:45 +00:00
akr 1054b79609 * ext/socket/lib/socket.rb (udp_server_sockets): unused variable
removed.
  patch by Jeremy Evans.  [ruby-core:38600]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 22:40:41 +00:00
nobu 72276eb06b * remove unused variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 15:49:36 +00:00
akr 14871a3786 * ext/socket/mkconstants.rb: fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 11:52:28 +00:00
akr b6ee29c9c0 * ext/socket/mkconstants.rb: use whitespaces as a separator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 11:29:49 +00:00
akr 8ef6a22144 * ext/socket/mkconstants.rb: add documents for constants.
patch by Eric Hodel.  [ruby-core:37853] [Bug #4989]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 10:03:25 +00:00
nagachika 60053a0a50 * ext/fiddle/closure.c (callback): use rb_ary_tmp_new() instead of
xmalloc() to allocate an array for arguments of callback procedure,
  to prevent arguments from being swept by GC. [ruby-core:38546]
  [Bug #4929]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 14:47:51 +00:00
nahi e7e87b3c4e * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible
SEGV from AES encryption/decryption. Processing data by
  Cipher#update without initializing key (meaningless usage of Cipher
  object since we don't offer a way to export a key) could cause SEGV.

  In OpenSSL, the EVP which has EVP_CIPH_RAND_KEY flag (such as DES3) 
  allows uninitialized key, but other EVPs (such as AES) does not
  allow it. Calling EVP_CipherUpdate() without initializing key causes
  SEGV so we set the data filled with "\0" as the key by default. See
  #2768.

* test/openssl/test_cipher.rb: test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 13:48:05 +00:00
nobu d3d44cd928 * ext/dl/callback/mkcallback.rb (gencallback): use PTR2NUM.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 03:32:56 +00:00
nobu eda13c7ee2 * ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointer
dereference.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 03:32:52 +00:00
nobu ad8ab9c013 * ext/dl/cptr.c (rb_dlptr_s_to_ptr): use rb_check_funcall.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 03:32:48 +00:00
nobu 79d8d7439a * ext/dl/cptr.c (rb_dlptr_s_to_ptr): fix wrapping condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 03:32:45 +00:00
nobu 9f3914aba6 * ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):
workaround to mark wrapped object.  this is not a true fix,
  because [Bug #4929] is caused by the interface design of DL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 17:15:09 +00:00
mrkn dca0b41777 * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
zero or negative precision is error.  fixes #5098.
  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:49:47 +00:00
mrkn 079fb8d4c3 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
specifying precision.  fixes #5098.  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:48:25 +00:00
mrkn 2fcb91c74c * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
for symmetry to BigDecimal() function with an Integer.
  fixes #5098.  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:46:42 +00:00
mrkn 5ba05758fe * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
for adapting other Numeric subclasses.  [ruby-dev:44245]
* test/bigdecimal/test_bigdecimal_util.rb: test for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:40:27 +00:00
mrkn a238140726 * bigdecimal/bigdecimal.c (VpDup) a new function for duplicating
a BigDecimal.

* bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
  BigDecimal from another BigDecimal using BigDecimal global function
  or constructor.  [ruby-dev:44245]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:40:23 +00:00
nahi 0a9b952c6f * ext/openssl/lib/openssl.rb: End of transition period introduced by
[ruby-dev:38018]. From the next version of 1.9.3, you should use
    require "openssl"
  instead of
    require "openssl/ssl"
  and
    require "openssl/x509"


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 06:30:07 +00:00
nahi 8c30497aae * ext/openssl/lib/openssl/x509.rb: Cosmetic change: move definition
introduced in r30152 to x509-internal.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 04:49:26 +00:00
nahi 6c8a2fe247 * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): Avoid randomly generated
SSLError from SSLSocket just after invoking SSLSocket#close. 
  OpenSSL's SSL_shutdown could try to send alert packet and it might 
  set SSLerr(global error stack) as the result. It causes the next
  SSL read/write operation to fail by unrelated reason.

  By design, we're ignoring any error at SSL_shutdown() so we clear 
  global error stack after SSL_shutdown is called. See #5039.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 04:30:02 +00:00
akr 29f354df63 * ext/socket/extconf.rb: refine the recvmsg test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-24 11:35:56 +00:00
akr 0283c3d0bb * ext/socket/extconf.rb: fix the recvmsg test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-24 11:04:11 +00:00
akr f5b9de7502 * ext/socket/extconf.rb: test recvmsg allocates file descriptors for
fd passing even with MSG_PEEK.

* ext/socket/ancdata.c: use the above test result.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 23:57:50 +00:00
tadf f99bed9330 * ext/date/date_core.c: an issue that is same as [ruby-dev:44071].
* ext/date/date_strftime.c: identical to [ruby-dev:44112].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 11:17:00 +00:00
akr 2bcd502a71 * io.c (rb_update_max_fd): validate fd.
* ext/socket/rubysocket.h (rsock_discard_cmsg_resource): add
  msg_peek_p argument for the declaration.

* ext/socket/ancdata.c (discard_cmsg): add msg_peek_p argument.
  assume FreeBSD, NetBSD and MacOS X doesn't generate passed fd
  when MSG_PEEK. 
  (rsock_discard_cmsg_resource): add msg_peek_p argument.
  (bsock_recvmsg_internal): call rsock_discard_cmsg_resource with
  msg_peek_p argument.

* ext/socket/unixsocket.c (unix_recv_io): call
  rsock_discard_cmsg_resource with msg_peek_p argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 08:13:37 +00:00
drbrain c1fa17c138 * ext/readline/readline.c: Add examples for Readline.completion_proc=.
[Ruby 1.9 - Bug #5057]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 04:52:22 +00:00
emboss af01784150 * ext/openssl/ossl_hmac.c: Revert checking return type of
HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 04:11:38 +00:00
emboss 00a006511b * ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.
* ext/openssl/ossl_hmac.c: Check return value of HMAC_Init_ex.
  Thanks, Jared Jennings, for the patch.
  [ Ruby 1.9 - Bug #4944 ] [ruby-core:37670]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 02:21:26 +00:00
emboss 84e835fe4a * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
* test/openssl/test_engine.rb: Add a test for it.
  Thanks to Ippei Obayashi for providing the patch.
  [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 00:13:07 +00:00
akr 272322bede * ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21 12:02:45 +00:00
akr b41ccc4a9c * include/ruby/intern.h (rb_update_max_fd): declaration moved from
internal.h.

* file.c: ditto.

* io.c: call rb_update_max_fd for each new fds.

* process.c: ditto.

* random.c: ditto.

* ruby.c: ditto.

* ext/io/console/console.c: ditto.

* ext/openssl/ossl_bio.c: ditto.

* ext/pty/pty.c: ditto.

* ext/socket/init.c: ditto.

* ext/socket/socket.c: ditto.

* ext/socket/ancdata.c: ditto.

* ext/socket/unixsocket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20 13:26:10 +00:00
naruse 13f62a384b * ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
before calling dlsym(). [ruby-dev:44091] [Bug #5021]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20 06:50:54 +00:00
tenderlove dc22968239 * ext/psych/lib/psych.rb: define a new BadAlias error class.
* ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
  deserializing an alias that does not exist.
* test/psych/test_merge_keys.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-18 04:38:37 +00:00
shugo e5f8aa95a3 * ext/curses/curses.c: added the new class Curses::Pad, which
supports scrolling.  patch by Eric Hodel.  [Feature #4896]
  [ruby-core:37206]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17 15:10:06 +00:00
nahi e56f2abe4b * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
Error caused by unalignment access on Sparc-Solaris (and possibly on
  other similar environment.) This patch just do memcpy always instead
  of checking architecture. I see no perf drop on my 64bit env. For
  more details, see #4320.

* test/digest/test_digest.rb: add test for unalignment access.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15 03:03:31 +00:00
nahi ab86f1cffb * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
verify callback of SSLContext and X509Store and make the 
  verification fail normally. Raising exception directly from callback
  causes orphan resouces in OpenSSL stack. Patched by Ippei Obayashi. 
  See #4445.

* test/openssl/test_ssl.rb
  (test_exception_in_verify_callback_is_ignored): test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-14 05:41:05 +00:00
mrkn 99f8f14d89 * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): fix
precision treatment errors.
* test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
  fix precision treatment errors.
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): precision argument
  should be optional for its compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 14:05:07 +00:00
naruse a2e497d5ed * ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
[Bug #4700]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 08:01:04 +00:00
tadf 32af4ed47f * ext/date/date_core.c: canonicalizes nth and sf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 05:59:12 +00:00
mrkn ebd61e5f28 * ext/bigdecimal/bigdecimal.c (BigDecimal_power): support non-integral
exponent.  fixes #3271
* ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): ditto.
* ext/bigdecimal/bigdecimal.c (BigDecimal_power_op): add a function to
  only use for "**" operator.
* test/bigdecimal/test_bigdecimal.rb: add a bunch of tests for the
  above changes.
* ext/bigdecimal/bigdecimal.c (is_integer): add an utility function.
* ext/bigdecimal/bigdecimal.c (is_negative): ditto.
* ext/bigdecimal/bigdecimal.c (is_positive): ditto.
* ext/bigdecimal/bigdecimal.c (is_zero): ditto.
* ext/bigdecimal/bigdecimal.c (is_one): ditto.
* ext/bigdecimal/bigdecimal.c (is_even): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 03:19:49 +00:00
tadf 057e0a373c * ext/date/date_core.c: some improvements for performance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 08:18:57 +00:00
nobu 29e497d231 * ext/json/{generator/generator.c,parser/parser.rl}: fix indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 09:00:54 +00:00
nobu bc1fd9458d * ext/json/parser/parser.rl (JSON_parse_object): add missing parens.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 09:00:51 +00:00
nobu 4902ef7d59 * ext/json/parser/parser.rl (convert_encoding): should not modify
the argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 07:40:41 +00:00
nobu b16fd08622 * ext/json/parser/parser.rl (convert_encoding): no needs to use
force_encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 07:39:09 +00:00
nobu c23dea553e * ext/json/parser/prereq.mk: remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 07:01:16 +00:00
usa 8de18f9cda * ext/openssl/ossl.h: include openssl/e_os2.h before checking the
defition of OPENSSL_SYS_WIN32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 06:03:17 +00:00
nobu 4837d6d5b5 * ext/-test-/string/enc_associate.c: needs ruby/encoding.h for
rb_to_encoding().  fixed #4993.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 02:08:29 +00:00
nobu cfa0035962 * encoding.c (rb_enc_set_index, rb_enc_associate_index): should
check if frozen.
* parse.y (rb_intern3), ruby.c (process_options, ruby_script):
  defer freezing after associating encodings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07 06:44:46 +00:00