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

4295 Коммитов

Автор SHA1 Сообщение Дата
emboss 976aba43c3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2011-12-25 18:53:45 +00:00
nobu 1dec79c324 * ext/readline/readline.c (readline_readline): check if outstream
is closed to get rid of a bug of readline 6.  [ruby-dev:45043]
  [Bug #5803]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-24 01:56:36 +00:00
kouji 5191ecad6c * ext/readline/readline.c (readline_attempted_completion_function):
in Readline module with GNU Readline 6 case, Readline module
  resets completion_append_character to " ", after it executes
  completion. So, Readline module stores
  completion_append_character, and Readline module always sets it
  after Readline module executes completion. [ruby-dev:43456]
  [Feature #4635]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-23 07:38:14 +00:00
kouji ec4f9d1c60 * ext/readline/readline.c (Init_readline): libedit check
rl_getc_function only when rl_initialize() is called, and
  using_history() call rl_initialize(). This assignment should be
  placed before using_history(). [ruby-core:40641] [Bug #5539]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-23 07:02:42 +00:00
kazu 0212af1733 * ext/bigdecimal/bigdecimal.h: add satisfy cc-mode comment.
* util.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-22 21:06:19 +00:00
nagachika c9a9036d0b ChangeLog: revert r34093. sorry, these are necessary for ruby-mode.el
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 15:50:15 +00:00
nagachika 4af11279c6 * ext/bigdecimal/bigdecimal.c (VpMult, VpCtoV, VpSqrt): remove assined
but unused variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 15:42:41 +00:00
nagachika af845f3528 * ext/bigdecimal/bigdecimal.h: remove unused lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 15:37:07 +00:00
nobu f9a4d5717c * ext/bigdecimal/bigdecimal.c (BigDecimal_s_allocate): follow
Allocation Framework.  [Bug #5775]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 03:35:27 +00:00
tenderlove 934b954a36 * ext/psych/emitter.c: fixing clang warnings. Thanks Joey!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 17:37:41 +00:00
kazu 327ea26b59 * ext/bigdecimal/README: Update redmine.ruby-lang.org to bugs.ruby-lang.org
* ext/socket/ancdata.c: ditto
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto
* test/syck/test_yaml.rb: ditto
* doc/ChangeLog-1.9.3: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 16:09:17 +00:00
tadf 5aea2ad18c * ext/date/date_core.c: uses to_integer instead.
* test/date/test_switch_hitter.rb: added a test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 12:03:42 +00:00
nahi be4f7bf512 * Make sure to clear $! when ignoring an exception
* ext/openssl/ossl.c (ossl_pem_passwd_cb0, ossl_verify_cb): 
  pem_passwd_cb and verify_cb ignores the exception raised in a 
  callback proc so it should clear $! for subsequent execution. 

  That's said, both subsequent processes for pem_passwd_cb and 
  verify_cb raises another exception before leaking $! to Ruby world.
  We cannot test this fix in Ruby land.

* test/openssl/test_pkey_rsa.rb
  (test_read_private_key_pem_pw_exception): Test for pem_passwd_cb + 
  exception.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 06:06:46 +00:00
naruse a9b0e34b97 * ext/date/date_core.c (wholenum): fix the type of the return value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 01:22:50 +00:00
tadf 305cd3fb00 * ext/date/date_core.c: [ruby-dev:45008].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-19 17:16:48 +00:00
nobu 9c00c1234d * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
allocation framework right now.  [ruby-core:41710] [Bug #5773]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 05:34:34 +00:00
tenderlove cf2bbc89d2 * ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
from YAML.
* ext/psych/lib/psych/visitors/yaml_tree.rb: BigDecimals can be dumped
  to YAML.
* test/psych/test_numeric.rb: tests for BigDecimal serialization

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 03:44:09 +00:00
tenderlove 9f688d53c2 * ext/psych/lib/psych/scalar_scanner.rb: Strings that look like dates
should be treated as strings and not dates.

* test/psych/test_scalar_scanner.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 03:05:02 +00:00
nobu 00e6c80221 * ext/strscan/strscan.c: use typed data with
onig_region_memsize().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-15 05:48:39 +00:00
nobu 9dccfb5513 * error.c (rb_check_typeddata): refine error message with
including expected struct name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-15 05:33:34 +00:00
nobu 84dcc38273 * regcomp.c (onig_region_memsize): implemented for memsize_of().
* ext/objspace/objspace.c (memsize_of): use it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-15 04:15:54 +00:00
nobu 5c68e601e8 * ext/stringio/stringio.c (strio_truncate): fix typo. patched by
Nick Howard <ndh AT baroquebobcat.com>.
  https://github.com/ruby/ruby/pull/65

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-12 06:41:05 +00:00
ktsj 9952139011 * ext/syslog/syslog.c: fix a typo. [ruby-core:41585] [Bug #5740]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-11 02:44:04 +00:00
usa f6a2a43116 * ext/extmk.rb (extract_makefile): should sort after map, not before
it.  in this case there is no difference, but we should write better
  code.  this bad smell was caught by nagachika.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-08 14:28:28 +00:00
usa d9d841e353 * ext/extmk.rb (extract_makefile): need to sort the array of current
srcs before comparing to the sorted old srcs.
  fixed the problem that the configuring stage of exts were always
  run, introduced at r33801.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-08 13:34:33 +00:00
naruse 2fbf66a7e1 Fix invalid test extension.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-08 10:27:01 +00:00
usa 2470d7811f * ext/socket/extconf.rb: forgotten to define HAVE_SOCKETPAIR for
windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-08 03:59:10 +00:00
drbrain 3a5daefe1f * ext/bigdecimal/bigdecimal.c: Document +@, -@, hash, INFINITY, Nan.
Patch by Sylvain Daubert.  [Ruby 1.9 - Feature #5622]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 01:58:59 +00:00
drbrain 12e7e79727 * io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]
* ext/io/console/console.c:  Mention that io/console must be required
  similar to lib/time.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 01:49:40 +00:00
tenderlove 54b214cc23 * ext/psych/lib/psych.rb (module Psych): parse and load methods take
an optional file name that is used when raising Psych::SyntaxError
  exceptions
* ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file
  names and handle nil file names in the exception message
* test/psych/test_exception.rb (module Psych): Tests for changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 23:12:37 +00:00
akr c5fada686d fix spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 10:38:28 +00:00
akr bb1875175b * ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING for
detect runtime Berkeley DB version.
  use dpversion instead of _QDBM_VERSION for detect runtime QDBM
  [ruby-dev:44948]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 10:21:12 +00:00
akr 2f49f5ee0b * ext/dbm/extconf.rb: detect gdbm_version in libgdbm.
* ext/dbm/dbm.c: make DBM::VERSION more informative for gdbm, qdbm and
  Berkeley DB 1.x.  [ruby-dev:44944]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 03:38:07 +00:00
usa 1dea192775 * include/ruby/{subst.h,win32.h}, ext/socket/rubysocket.h: revert
r33876.  [ruby-core:41475] [Bug #5706]

* ext/socket/extconf.rb: the alternative hack for [Bug #5675].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05 05:29:31 +00:00
usa 8229b9dd3f * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
1st, to change the mode of an IO is very sensitive problem, so
  the maintainer of this library should judge it.
  2nd, usually Zlib::GzReader.new is not called directly.  #initialize
  is called via .open, and in the method the I/O is opened in binary
  mode, so there is no problem without changing the mode in #initialize.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05 01:25:47 +00:00
luislavena f9a6a1dd0c Introduce NEED_READCONV and NEED_WRITECONV to replace universal newline decorator
Use CRLF only when required to improve file reading and writing under Windows.
Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04 01:10:06 +00:00
nobu d0b2816d02 * ext/bigdecimal/bigdecimal.c (VpAllocReal): reduce extra frac.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-02 06:48:10 +00:00
nobu b0f588fe0e * ext/socket/extconf.rb: get rid of warnings by
-Wmissing-declarations or -Wold-style-definition options.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-01 08:45:22 +00:00
nobu 05e2da638f * ext/socket/extconf.rb: add arguments for macro calls.
[ruby-core:41370] [Bug#5681]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-01 07:59:21 +00:00
nobu a394c59be3 * ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
clang.  [ruby-core:41418] [Bug#5693]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-01 05:43:22 +00:00
naruse f6f4534382 * variable.c (rb_path2class): don't raise NameError when the middle
constant of the path is not defined but defined on toplevel.
  [ruby-core:41410] [Bug #5691]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-30 14:44:06 +00:00
drbrain 8b7ecdc11e * lib/mkmf.rb: Use MakeMakefile's rm_f to avoid conflict with Rake or
FileUtils.
* test/ruby/test_module.rb:  Hide MakeMakefile's inclusion in Object


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-30 00:57:24 +00:00
tenderlove 0df90074c7 * ext/psych/parser.c (parse): parse method can take an option file
name for use in exception messages.
* test/psych/test_parser.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-30 00:10:31 +00:00
naruse 302b6f6e02 Don't break tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-29 08:42:13 +00:00
drbrain 194882cc40 * lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object
documentation.  [Ruby 1.9 - Feature #5658]
* ext/extmk.rb:  Use MakeMakefile::CONFIG instead of Object::CONFIG
* test/mkmf/base.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28 21:54:33 +00:00
nobu 1510ad86c4 * include/ruby/subst.h: moved Windows specific substitions from
win32.h.
* ext/socket/rubysocket.h: include ruby/subst.h.  [Bug #5675]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28 01:36:09 +00:00
nobu ef05fbd0fb * ext/tk/tcltklib.c (eventloop_sleep): unused.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-27 06:22:00 +00:00
emboss 41fa4bd715 * ext/openssl/extconf.rb: remove checks for available functions.
* ext/openssl/missing.h: ditto.
  Thanks, Tim Mooney for reporting this!
  [Bug #5432] [ruby-core:40088]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-26 01:49:36 +00:00
emboss bdf357bf5e * ext/openssl/ossl_ssl.c: add comment on where to find implementation
of OpenSSL::SSL::SSLSocket#session.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-26 01:25:07 +00:00
emboss 29b0d9d932 * ext/openssl/ossl_pkey_dsa.c: remove redundant colon from error
message.
* ext/openssl/ossl_ssl.c: ditto.
* ext/openssl/ossl_pkey_rsa: ditto.
[Bug #5604] [ruby-core:40896]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-23 23:15:09 +00:00
tenderlove daeaa65f08 * ext/psych/lib/psych.rb: remove autoload from psych
* ext/psych/lib/psych/json.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-21 19:47:09 +00:00
nobu c2c6687ddb * ext/extmk.rb (extract_makefile, extmake): regenerate makefiels
if globbed source file list is changed.
* lib/mkmf.rb (create_makefile): store ORIG_SRCS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20 14:22:44 +00:00
nobu aa347ba042 * ext/tk/tkutil/tkutil.c (cbsubst_info): fix shorten-64-to-32 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20 14:19:04 +00:00
nobu 22dcc88584 * ext/tk/tkutil/tkutil.c: fix shorten-64-to-32 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20 14:02:02 +00:00
akr 54f282c2c4 * lib/pathname.rb (Pathname#find): return an enumerator if
no block is given.

* test/pathname/test_pathname.rb: add tests for above.

[ruby-dev:44797] [Feature #5572]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-19 12:52:37 +00:00
nobu 714ec98ec4 * ext/io/console/console.c (console_raw, console_set_raw)
(console_getch): optional parameters.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 08:18:18 +00:00
nobu 3723ac22d2 * ext/io/console/console.c (console_cooked, console_set_cooked):
new methods to reset cooked mode.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 07:12:14 +00:00
akr 09d2180d2d * ext/dbm/extconf.rb: revert a part of the patch in [ruby-dev:41531].
don't use db.h with other headers.  [ruby-dev:44884].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-17 11:45:32 +00:00
tenderlove 07636686da * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are
also closed. [ruby-core:41088]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-17 01:38:16 +00:00
usa ce03ef0242 * ext/-test-/num2int/num2int.c: remove an unnecessary and wrong decl
of rb_stdout.  it's declared in ruby.h correctly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-16 01:46:43 +00:00
nobu dbb03fdc96 * ext/openssl/ossl_asn1.c: get rid of potential overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15 13:55:38 +00:00
akr 3d25acdccc * io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: use
__linux__ macro for consistency.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15 11:09:47 +00:00
akr b848d4f9c8 * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_file): set close-on-exec
flag.

* ext/openssl/ossl_x509cert.c (rb_fd_fix_cloexec): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 13:06:51 +00:00
akr 158a828c97 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 11:22:15 +00:00
nobu 958caf186f * ext/-test-/num2int/num2int.c: should return valid values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 08:17:49 +00:00
kosaki b2a2ba1191 * include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.
* numeric.c: ditto.

* test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT().
* ext/-test-/num2int/num2int.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:54:34 +00:00
kosaki 74a13c7634 * numeric.c (check_uint): fix off-by-one bug of NUM2UINT.
* bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG.

* test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT()
  NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL().
* ext/-test-/num2int/depend: ditto.
* ext/-test-/num2int/extconf.rb: ditto.
* ext/-test-/num2int/num2int.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:45:47 +00:00
nobu 416778c5d8 * ext/dbm/extconf.rb: use convertible_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 14:47:31 +00:00
akr 4b01d611db * ext/gdbm/gdbm.c (fgdbm_reorganize): set close-on-exec flag after
gdbm_reorganize().  gdbm_reorganize() opens a new database internally.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 14:22:17 +00:00
akr abe61eb0d1 update comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 12:32:15 +00:00
akr bfed16a21f * ext/dbm/extconf.rb: rollback for each headers for each libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 10:58:18 +00:00
akr e8ca9cc343 * ext/dbm/extconf.rb: treat libc as a choice for a library which
provide ndbm API.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 07:25:40 +00:00
akr 3e5bff7ec1 * ext/dbm/extconf.rb: duplicate $libs and $defs when save them.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 06:41:19 +00:00
akr 2b2ef5cfce * ext/dbm/extconf.rb: rollback $libs and $defs when db detection is
failed.  It fixes -lgdbm -lqdbm when the system has qdbm and gdbm
  without gdbm_compat.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 03:47:07 +00:00
nobu 521f420a77 * ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12 08:01:51 +00:00
akr 0eb08aa068 update comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12 07:50:12 +00:00
akr df2e1f85d2 * ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbm
implementation.  If it is not available, it is caused by
  header/library mismatch such that Berkeley DB header & gdbm library.

* ext/dbm/dbm.c (fdbm_store): use dbm_clearerr() unconditionally.
  gdbm 1.9 provides it as a real function instead of a empty macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12 07:06:09 +00:00
akr db48bbdf0b * ext/dbm/extconf.rb: db_prefix is not required now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 14:01:25 +00:00
akr 268f6c3680 * ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 12:14:23 +00:00
akr 266d09839b * ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with
Berkeley DB.  Macro definitions needs arguments to detect correctly.
  SIZEOF_DSIZE needs -DDB_DBM_HSEARCH because db.h defines datum type
  only if DB_DBM_HSEARCH is defined. 



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 12:03:51 +00:00
akr 688e1b34a6 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 03:35:49 +00:00
akr e68f4ac7dc add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-10 11:39:16 +00:00
nobu 6c9a235938 * ext/dbm/extconf.rb: set DB_DBM_HSEARCH macro to check dbm_pagfno and
dbm_dirfno on older Debian.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-10 06:43:46 +00:00
nobu fb1836ab48 * ext/dbm/extconf.rb: check for dsize as LONG_LONG.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-10 06:43:44 +00:00
drbrain a5fc87bd5b * ext/openssl/lib/openssl/ssl.rb (class OpenSSL::SSL::SSLContext):
Document #set_params.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09 23:45:39 +00:00
akr 3f289d9237 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09 13:26:06 +00:00
tenderlove 4c63e02740 * ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
rationals, etc with reference ids.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* ext/psych/lib/psych/visitors/to_ruby.rb: loading complex numbers,
  rationals, etc with reference ids.
* test/psych/test_object_references.rb: corresponding tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 19:54:44 +00:00
nobu 0e4c2ce841 * ext/dbm/dbm.c (fdbm_fetch, fdbm_key, fdbm_delete, fdbm_store)
(fdbm_has_key, fdbm_has_value): get rid of overflow.
* ext/gdbm/gdbm.c (rb_gdbm_fetch2, rb_gdbm_nextkey)
  (rb_gdbm_delete, fgdbm_store, fgdbm_has_key): ditto.
* ext/dbm/dbm.c (fdbm_delete_if): hide intermediate objects.
* ext/gdbm/gdbm.c (fgdbm_delete_if): ditto.
* ext/dbm/extconf.rb: check size of datum.dsize to get rid of
  overflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 14:34:39 +00:00
nobu ebe0280253 * ext/tk/tcltklib.c (rb_thread_critical): fix type.
* ext/tk/tcltklib.c (eventloop_sleep, lib_eventloop_core): int is
  enough for micro seconds.  may need to check overflow in the
  setter though.
* ext/tk/tcltklib.c (RSTRING_LENINT): check overflow if necessary.
* ext/tk/tcltklib.c (RbTk_ALLOC_N): wrapper for ckalloc() which
  takes an int.
* ext/tk/tcltklib.c (ip_ruby_cmd_receiver_get, tcltklib_compile_info):
  get rid overflow.
* ext/tk/tcltklib.c (tcltklib_compile_info): constified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 14:26:51 +00:00
akr c2c0707949 * ext/pty/pty.c (MasterDevice): define only when used.
(SlaveDevice): ditto.
  (deviceNo): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 10:04:32 +00:00
nobu 4d36509054 * ext/-test-/old_thread_select/extconf.rb: ignore deprecated
declaration warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 09:02:59 +00:00
naruse 452bf3b9c9 * ext/pty/pty.c (get_device_once): FreeBSD 8 supported O_CLOEXEC flag
for posix_openpt, but FreeBSD 9's posix_openpt doesn't support
  O_CLOEXEC and fails if specified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 08:26:00 +00:00
naruse ce19ae0ef0 * ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn't
support O_CLOEXEC and fails if specified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 02:03:57 +00:00
akr 4764756497 * ext/gdbm/gdbm.c (fgdbm_initialize): set close-on-exec flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 13:05:43 +00:00
akr 733a57b878 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 12:16:10 +00:00
tenderlove e115627a18 * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
like base 60 numbers are serialized as quoted strings.
* test/psych/test_string.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 11:33:39 +00:00
akr e4e5b7df4c * ext/dbm/extconf.rb: check dbm_pagfno() and dbm_dirfno().
* ext/dbm/dbm.c: use above to set close-on-exec flag.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 11:17:17 +00:00
akr 5cb6365487 * ext/socket/rubysocket.h (rsock_recvmsg): declared.
* ext/socket/ancdata.c (rsock_recvmsg): extracted from
  nogvl_recvmsg_func.
  (nogvl_recvmsg_func): use rsock_recvmsg.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-06 05:51:43 +00:00
akr a3521e0261 * ext/socket/socket.c (rsock_socketpair0): refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 09:06:05 +00:00
akr 385a7d4594 * ext/socket/init.c (rsock_socket0): don't clear try_sock_cloexec if
SOCK_CLOEXEC is not a reason for EINVAL.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 08:56:50 +00:00
ktsj c3749b6a6d * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
  lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
  lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
  lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
  lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
  lib/shell/command-processor.rb, lib/shell/process-controller.rb,
  lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
  arguments to avoid creating Proc objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 07:37:47 +00:00
akr 0e68c46e2d * ext/socket/init.c (rsock_socket0): extract single socket() call with
CLOEXEC handling from rsock_socket.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 06:46:02 +00:00
akr df390d82f9 * ext/socket/socket.c (rsock_socketpair0): don't clear
try_sock_cloexec if SOCK_CLOEXEC is not a reason for EINVAL.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 02:19:48 +00:00
nobu 413f24d3b0 * whitespace cleanup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04 07:19:23 +00:00
nahi ab682d95e0 * ext/openssl/ossl_pkey_rsa.c (rsa_generate): [SECURITY] Set RSA
exponent value correctly.  Awful bug.  This bug caused exponent of
  generated key to be always '1'.  By default, and regardless of e
  given as a parameter.
    
  !!! Keys generated by this code (trunk after 2011-09-01) must be 
  re-generated !!! (ruby_1_9_3 is safe)
        
* test/openssl/test_pkey_rsa.rb: Add tests for default exponent and
  specifying exponent by a parameter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04 05:12:31 +00:00
emboss 00bfe1940e * ext/openssl/extconf.rb:
* ext/openssl/ossl_engine.c: add some missing OpenSSL engines.
  Thanks, Yui Naruse, for providing the patch!
  [Bug #5548] [ruby-core:40670]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03 23:45:23 +00:00
naruse b2f90f4d51 * ext/readline/readline.c (Init_readline): like r18313, libedit's
replace_history_entry may use offset instead of which.
  so introduce history_replace_offset_func and initialize it.

* ext/readline/readline.c (hist_set): use history_replace_offset_func.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03 16:23:58 +00:00
naruse 21ab6bc3fa * ext/readline/readline.c (Init_readline): fix wrong condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03 15:54:19 +00:00
akr b45c882aec * ext/socket/socket.c (rsock_socketpair0): extracted from
rsock_socketpair to set close-on-exec flag for each socketpair()
  call.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03 13:46:41 +00:00
nagachika a0b22b1a39 * ext/socket/init.c (rsock_socket): set close-on-exec flag when
SOCK_CLOEXEC is not available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03 13:14:48 +00:00
akr 1bbae2431f add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01 03:04:53 +00:00
akr c16f98ab0a * io.c (rb_maygvl_fd_fix_cloexec): renamed from fd_set_cloexec.
* internal.h (rb_maygvl_fd_fix_cloexec): declared.

* ext/socket/init.c (cloexec_accept): use rb_maygvl_fd_fix_cloexec.
  (rsock_s_accept_nonblock): use rb_update_max_fd.
  (rsock_s_accept): use rb_update_max_fd.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01 03:04:03 +00:00
akr 5dbc3d1e79 * ext/socket/init.c (cloexec_accept): new function to use accept4 if
available.
  (rsock_s_accept_nonblock): use cloexec_accept.
  (accept_blocking): ditto.

* ext/socket/extconf.rb: check accept4.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 23:26:19 +00:00
akr 7ae60a6b0d * ext/socket/ancdata.c (nogvl_recvmsg_func): use MSG_CMSG_CLOEXEC if
available.

* ext/socket/unixsocket.c (recvmsg_blocking): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 22:32:49 +00:00
akr ee5ae134dd * ext/socket/socket.c (rsock_socketpair): use SOCK_CLOEXEC if
available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 21:01:18 +00:00
akr 8ce4a284e4 * ext/socket/socket.c (rsock_socketpair): extracted from
rsock_sock_s_socketpair.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 14:49:57 +00:00
akr 1a8fbff3db * ext/socket/init.c (rsock_socket): use SOCK_CLOEXEC if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 14:38:50 +00:00
akr a16c2745fe * ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 13:07:26 +00:00
akr 1a70dfe6f4 * include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
rb_fd_set_cloexec.

* io.c: follow the above renaming.

* 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@33585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 12:49:16 +00:00
akr 92a8bfacd9 * ext/pty/pty.c (get_device_once): use O_CLOEXEC for posix_openpt if
available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 03:39:01 +00:00
akr 4ae2b92576 * include/ruby/intern.h (rb_cloexec_dup): declared.
* io.c (rb_cloexec_dup): new function.
  (ruby_dup): use rb_cloexec_dup.

* ext/pty/pty.c (pty_getpty): use rb_cloexec_dup.
  
* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 11:02:32 +00:00
akr 3bffb5f306 * ext/sdbm/_sdbm.c (sdbm_prep): use O_CLOEXEC if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 07:12:09 +00:00
akr da74bc7552 * process.c (ruby_setsid): use rb_cloexec_open.
(rb_daemon): ditto.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/io/console/console.c (console_dev): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 04:01:54 +00:00
akr 769fcd7048 * ext/sdbm/_sdbm.c: RCS $Id$ removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-28 13:06:16 +00:00
akr 509ed0d94f * ext/sdbm/_sdbm.c (sdbm_prep): set FD_CLOEXEC flags for file
descriptors.
  (fd_set_cloexec): new function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-27 21:07:23 +00:00
akr f8751046b8 * ext/sdbm/_sdbm.c (sdbm_prep): refactored for less nesting.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-27 15:11:06 +00:00
emboss 2b7bbe18b3 * ext/psych/parser.c: remove unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-26 23:49:49 +00:00
emboss 4fe2dacee7 * ext/openssl/extconf.rb: add -Wall flag by default when compiler is
GCC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-26 23:43:04 +00:00
akr 2bb5441808 * complex.c: use "__sun" instead of "__sun__" to detect SunOS.
* math.c: ditto.

* hash.c: ditto.

* atomic.h: ditto.

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

[ruby-dev:44693]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 14:57:08 +00:00
akr b317a4cd28 * io.c: use "__sun" instead of "sun" to detect SunOS.
* dln.c: ditto.

* cont.c: ditto.

* ext/sdbm/_sdbm.c: ditto.

[ruby-dev:44693]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 13:49:58 +00:00
akr 5153fd2a5e * ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() until
grantpt() on Solaris.  grantpt() doesn't work with CLOEXEC on
  Solaris 10.
  reported by Naohisa GOTO.  [ruby-dev:44688] [Bug #5475]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 13:40:13 +00:00
ktsj b062e60805 * ext/tk/MANUAL_tcltklib.eng: fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23 09:22:59 +00:00
ngoto d332891fdd * ext/io/wait/wait.c: ioctl(2) is declared in unistd.h on Solaris.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23 07:51:10 +00:00
ayumin 965dba4faa * ext/tk/MANUAL_tcltklib.eng: fix typo. [ruby-dev:44683] [Bug #5471]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23 07:39:56 +00:00
akr b574a4d4a1 * include/ruby/intern.h (rb_fd_set_cloexec): declared.
* io.c (rb_fd_set_cloexec): new function.
  (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
  (rb_sysopen_internal): ditto.
  (rb_pipe): ditto.
  (io_reopen): ditto.
  (io_cntl): ditto.

* process.c (rb_f_exec): change the default :close_others option to
  true.
  (rb_f_system): ditto.
  (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
  close-on-exec flag.
  (ruby_setsid): ditto.
  (rb_daemon): ditto.

* thread_pthread.c (rb_thread_create_timer_thread): call
  rb_fd_set_cloexec to set close-on-exec flag.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.

* ext/socket/init.c (rsock_socket): ditto.
  (rsock_s_accept_nonblock): ditto.
  (rsock_s_accept): ditto.

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

* ext/socket/ancdata.c (discard_cmsg): ditto.
  (make_io_for_unix_rights): ditto.

* ext/socket/unixsocket.c (unix_recv_io): ditto.

* ext/io/console/console.c (console_dev): ditto.

[ruby-core:38140] [Feature #5041]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22 09:58:15 +00:00
emboss b878cfa971 * ext/openssl/ossl_ns_spki.c: Complete documentation.
* test/openssl/test_ns_spki.rb: Integrate SPKI#to_text.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-20 17:22:09 +00:00
emboss 98490d1f71 * ext/openssl/ossl_pkcs5.c: add note on timing attacks and general
documentation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-20 13:48:21 +00:00
nobu 72cbec3f6d * util.c (mmprepare): fix for fragmental size.
* util.c (mmswap_, mmrot3_): portability improvement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-20 02:42:26 +00:00
drbrain 2e32ad8163 * ext/openssl/ossl_ns_spki.c (Init_ossl_ns_spki): Stub documentation
for Netscape SPKI.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-19 21:05:05 +00:00
emboss 65ca601ba6 * lib/openssl/buffering.rb: Force multi-byte strings to be treated as
binary data.
* test/openssl/test_ssl.rb: Add test for it.

Thanks to Niklas Baumstark for reporting the issue!

[Ruby 1.9 - Bug #5233] [ruby-core:39120]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-19 20:05:21 +00:00
emboss c35204f7bd * ext/openssl/ossl_ssl.c: Remove set, but unused variables.
ext/openssl/ossl_pkey.c: ditto

* ext/openssl/ossl_pkey_dh.c: Make functions passed to
  rb_thread_blocking_region return VALUE instead of void. 
  ext/openssl/ossl_pkey_dsa.c: ditto
  ext/openssl/ossl_pkey_rsa.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-19 01:15:35 +00:00
nobu 560a6c6ffa * ext/ripper/eventids2.c (ripper_init_eventids2): separate
initializations of IDs and objects.
* ext/ripper/tools/generate.rb (generate_eventids1): ditto.
* parse.y (Init_ripper, InitVM_ripper): fix inversed roles.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-18 14:05:51 +00:00
nobu e6ce15c68a * ext/bigdecimal/bigdecimal.gemspec (files): fixed typo, and
removed nonexistent file.
* ext/bigdecimal/bigdecimal.gemspec (homepage): added.
* ext/io/console/io-console.gemspec (homepage): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-16 10:46:30 +00:00
nobu 039f12b5bb * ext/pty/pty.c (pty_check): should return nil until the child
terminates or stops.  [ruby-dev:44600] [Bug #2642]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-14 03:14:00 +00:00
drbrain ccec5b49ca * ext/coverage/coverage.c (Init_coverage): Change list format and
describe Coverage.result output.  Patch by Sylvain Daubert.
  [Ruby 1.9 - Bug #5428]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-10 21:06:39 +00:00
nobu 89fef02f13 * vm_eval.c (make_no_method_execption): extract from
raise_method_missing().
* vm_eval.c (send_internal): remove inadvertent symbol creation
  from public_send.  based on a patch by Jeremy Evans <code AT
  jeremyevans.net> in [ruby-core:38576]. [Feature #5112]
* vm_insnhelper.c (vm_call_method): remove inadvertent symbol
  creation from send and __send__, too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-06 07:29:33 +00:00
tenderlove 137c547c3e * ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
message attributes during parse failure.
* ext/psych/parser.c: Update parser to raise exception with correct
  values.
* test/psych/test_exception.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 17:53:41 +00:00
tenderlove 77e58a3398 * ext/psych/parser.c (parse): Use context_mark for indicating error
line and column.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 16:53:14 +00:00
tenderlove b7c66e31de * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
since postfix rescue cannot receive the exception class. Thanks
  nagachika!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 16:24:58 +00:00
drbrain 14f878aed6 * ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
by mathew murphy.  [Ruby 1.9 - Bug #5396]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 23:33:57 +00:00
tenderlove 9167328359 * ext/psych/lib/psych.rb: update psych version.
* ext/psych/psych.gemspec: generate new gemspec for new version.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:44:38 +00:00
tenderlove 1c60db55ac * ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
* ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
  in order to avoid YAML::ENGINE switching from replacing this method.
* test/psych/helper.rb: fix tests for method name change.
* test/psych/test_document.rb: ditto
* test/psych/visitors/test_emitter.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:31:43 +00:00
tenderlove bd3b0d470c * ext/psych/lib/psych/scalar_scanner.rb: Match values against the
floating point spec defined in YAML to avoid erronious parses.
* test/psych/test_numeric.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:21:31 +00:00
tenderlove 1721fca3ad * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
constructed with a ScalarScanner.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
  passed to the YAMLTree visitor.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:00:50 +00:00
tenderlove bdadd49940 * ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
for 1.9.2 backwards compatibility.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Fix Date string
  generation for 1.9.2 backwards compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 20:49:19 +00:00
nobu ce515f5c8f * ext/gdbm/gdbm.c (rb_gdbm_fatal): adjust argument type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29 11:37:47 +00:00
ayumin 839b4b5125 Fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-28 10:17:26 +00:00
ayumin fcb2bb8bd6 * ext/bigdecimal/README: update report to.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-27 19:15:51 +00:00
mrkn 0e18153140 * ext/bigdecimal/bigdecimal_en.html: removed because this file isn't
maintained now.
* ext/bigdecimal/bigdecimal_ja.html: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-27 19:06:52 +00:00
kosaki 20ae79b0c2 * include/ruby/defines.h: remove NextStep, OpenStep, Rhapsody
support. Last activity of their OSs are 7 years ago.
* configure.in: ditto.
* dir.c: ditto.
* ext/tk/extconf.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26 00:19:03 +00:00
emboss 8b7e10879e * ext/openssl/ossl_asn1.c: fix int_ossl_asn1_decode0_cons when being
fed arbitrary string values.
  Clearly distinguish between the cases "universal, infinite and
  not a SEQUENCE or SET" and "universal SEQUENCE or SET, possibly
  infinite". Raise error for universal tags that are not infinite.
* test/openssl/test_asn1.rb: add a test for this.

  Thanks to Hiroshi Yoshida for reporting this bug.
  [Bug #5363] [ruby-dev:44542]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25 14:51:20 +00:00
nobu 62dfc45bb2 suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25 07:42:38 +00:00
emboss 3a16362371 * ext/openssl/ossl_asn1.c: remove unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-23 05:21:54 +00:00
ayumin 2fecb27eb4 Merge branch 'tk_utf8' into trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-14 17:25:37 +00:00
kosaki 2c9375ba69 * thread.c (rb_thread_select): fix to ignore an argument
modification of rb_thread_fd_select().
  based on a patch by Eric Wong. [Bug #5306] [ruby-core:39435]
* thread.c (rb_fd_rcopy): New. for reverse fd copy.

* test/-ext-/old_thread_select/test_old_thread_select.rb
(test_old_select_false_positive): test for bug5306.

* ext/-test-/old_thread_select/old_thread_select.c (fdset2array):
  New. convert fdsets to array.
* ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
  return 'read', 'write', 'except' argument of rb_thread_select()
  to ruby script.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-12 11:36:06 +00:00
ayumin 0abbe4c1e6 * ext/bigdecimal/bigdecimal.c (BigDecimal_abs): Fix comment.
BigDecimal#sqrt requires argument. Reported by Makoto Kishimoto.
  Thanks for your contribution. [Bug #5267] [ruby-dev:44452]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 13:06:51 +00:00
naruse 05558e04b8 * ext/nkf/nkf-utf8/nkf.c: import nkf 2.1.2 (be9c280)
Bump version number/release date only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-08 12:17:06 +00:00
naruse 7dc427f7ed * ext/syck/lib/syck/types.rb: use toplevel Syck.
for the case someone define Syck::Syck (or YAML::Syck).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 22:37:34 +00:00
naruse e3532c8bde Revert "Change encoding from ISO-2022 to UTF-8"
This reverts commit r33213.
Don't change nkf which is imported from upstream.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 22:17:55 +00:00
ayumin 776a2d9ddf * ext/readline/README.ja:
Change encoding from EUC-JP to UTF-8


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 18:51:10 +00:00
ayumin 9f4dd65e89 Change encoding from ISO-2022 to UTF-8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 17:56:24 +00:00
naruse 179cf473c2 Fix typo: U+0456->U+0069. [Bug #5275]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05 09:05:13 +00:00
nobu 4ac511266d * ext/io/console/console.c (console_set_winsize): remove
unused variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:54:14 +00:00
tenderlove 8659de2e0f * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
ascii-8bit as binary in YAML.
* test/psych/test_string.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 19:07:44 +00:00
nahi d3507e3ea6 * Release GVL while OpenSSL's public key generation.
t = Thread.new { print "."; sleep 0.1 }
    key = OpenSSL::PKey::RSA.new(2048)
    #=> Thread t works in parallel with public key generation if
        OS/machine allows it.

  This works with OpenSSL >= 0.9.8. From this version, it has new 
  public key generation function which allows us to interrupt the
  execution while pkey generation iterations.

* ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
  generation function. (DH_generate_parameters_ex,
  DSA_generate_parameters_ex and RSA_generate_key_ex.

* ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
  ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
  generation which handles Thread interruption by Ruby.
  ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
  sets a stop flag. New pkey generation callback ossl_generate_cb_2
  checks the stop flag at each iterations of OpenSSL and interrupts
  pkey generation when the flag is set.

* ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
  rb_thread_blocking_region with the above unblock function to release
  GVL while pkey generation.

* ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.

* ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.

* test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 07:42:29 +00:00
naruse c06658feba * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 06:56:16 +00:00
usa 34e65bee79 * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
typo.

* test/-ext-/old_thread_select/test_old_thread_select.rb
  (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
  of SIGUSR1 because the former is general and the latter is platform
  dependent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:07:21 +00:00
naruse 28bba481f9 Don't include complex and rational; fix r33122.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 05:21:27 +00:00
naruse b14c060dda * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
[Bug #5173] [ruby-core:38866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 02:23:12 +00:00
kosaki 0cebfad20a * thread.c (rb_thread_select): rewrite by using
rb_thread_fd_select(). old one is EINTR unsafe.
  Patch by Eric Wong. [Bug #5229] [ruby-core:39102]

* test/-ext-/old_thread_select/test_old_thread_select.rb:
  a testcase for rb_thread_select().
* ext/-test-/old_thread_select/old_thread_select.c: ditto.
* ext/-test-/old_thread_select/depend: ditto.
* ext/-test-/old_thread_select/extconf.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:33:05 +00:00
nagachika 0d530b2392 * ext/date/date_parse.c (date_zone_to_diff): keep a temporary string
stored in variable while the contents buffer is beeing used.

* ext/date/date_parse.c (date_zone_to_diff): get rid of out of bounds
  memory read.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-28 06:53:47 +00:00
drbrain ca96541149 * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch
by Luke Gruber.  [#5203]
* ext/pty/lib/expect.rb:  ditto
* lib/mathn.rb:  ditto
* lib/net/http.rb:  ditto
* lib/open-uri.rb:  ditto
* lib/ostruct.rb:  ditto
* lib/tempfile.rb:  ditto
* lib/thread.rb:  ditto
* lib/weakref.rb:  ditto
* sample/webrick/httpproxy.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-26 22:22:37 +00:00
drbrain 965f51b348 * ext/openssl/lib/openssl/bn.rb: Hide copyright info from RDoc.
* ext/openssl/lib/openssl/digest.rb:  ditto
* ext/openssl/lib/openssl/x509.rb:  ditto
* ext/openssl/lib/openssl/cipher.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25 00:43:45 +00:00
drbrain b0fb4fb689 * ext/openssl/ossl_digest.c: Document OpenSSL::Digest::digest and add
an example to OpenSSL::Digest.  Patch by Sylvain Daubert.
  [Ruby 1.9 - Bug #5166]
* ext/openssl/lib/openssl/digest.rb (module OpenSSL):  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25 00:29:02 +00:00
tenderlove 72107daf0e * ext/psych/lib/psych.rb: Fixing psych version number.
* ext/psych/psych.gemspec: updating the gemspec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 21:54:27 +00:00
tenderlove 34f6671d68 * ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
UTF-8.
* test/psych/test_encoding.rb: test yaml dump encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 21:14:44 +00:00
nahi e3e985064a * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section of
gzip header is readable to avoid SEGV.

* test/zlib/test_zlib.rb (test_corrupted_header): Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 02:36:13 +00:00
nobu dcb7cc1a8b * ext/stringio/stringio.c (strio_read): return new string if nil
is explicitly given as a buffer ([Bug #5207]), otherwise set the
  encoding.  also removed dead code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-20 01:43:26 +00:00
mrkn 52c7bbd444 * ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
remove duplication.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-17 14:04:22 +00:00
mrkn 4e8d6c105c Merge branch '5172_bigdecimal_gc_issue' into trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-17 06:35:21 +00:00
emboss 783fb0881f * ext/openssl/ossl_x509cert.c: fixed whitespace issues
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-16 21:41:25 +00:00
emboss 515d546d76 * ext/openssl/ossl_x509cert.c: Add class documentation for
OpenSSL::X509::Certificate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-16 21:37:46 +00:00
emboss a517fe0518 * ext/openssl/ossl_pkey.c: corrected docs, OpenSSL::PKey::DH does
*not* support #sign/verify.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-16 19:59:38 +00:00
drbrain de6d4f7e7b * ext/dl: Add documentation. Patch by Vincent Batts. [Ruby 1.9 - Bug #5192]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-16 00:34:51 +00:00
drbrain 87ff4b24ae * ext/.document (fiddle): Remove duplicate entry
* ext/fiddle:  Complete documentation of Fiddle.  Patch by Vincent
  Batts.  [#5192]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-15 23:48:59 +00:00
drbrain 1297942451 * ext/socket: Make Socket documentation appear. Add documentation for
Socket, TCPServer, SOCKSSocket.  Patch by Sylvain Daubert.
  [Ruby 1.9 - Feature #5182]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-15 23:08:39 +00:00
emboss 1be5789eed * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression.
* test/openssl/test_ssl.rb: Add a test for it.
  Thanks to Eric Wong for the patch.
  [Ruby 1.9 - Feature #5183] [ruby-core:38911]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-15 01:10:26 +00:00
tadf 75de442dd0 * ext/date/date_core.c: [ruby-core:38861]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 08:05:43 +00:00
nagachika 14b57772ec * ext/date/date_parse.c parse_ddd_cb): fix r32896. RB_GC_GUARD
insertion position was mistaken. [ruby-dev:44337] [Bug #5152]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:40:06 +00:00
tenderlove 5339bbe2dc * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
[ruby-core:38913]
* test/psych/test_yaml.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:27:44 +00:00
tadf 0acaab201a * ext/date/date_core.c (date_strftime_alloc): followed the change
of r32885.
	* doc/NEWS-1.9.3: followed the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:12:05 +00:00
tenderlove b5f05971f5 * ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
with fewer than 2 dots to be numbers. [ruby-core:38915]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:00:26 +00:00
tadf e8b3d0decf * ext/date/date_core.c: [ruby-core:38855].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-12 23:48:18 +00:00
drbrain c233d6592d * ext/digest/digest.c: Add documentation for the Digest module. Patch by
Sylvain Daubert.  [Ruby 1.9 - Bug #5167]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-12 17:23:11 +00:00
akr 5622574976 * ext/socket/ipsocket.c (init_inetsock_internal): use SOMAXCONN for
listen backlog.

* ext/socket/unixsocket.c (rsock_init_unixsock): ditto.

* ext/socket/lib/socket.rb (Addrinfo#listen): ditto.
  (Socket.tcp_server_sockets_port0): ditto.

* ext/socket/mkconstants.rb: define SOMAXCONN as 5 if not available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-11 23:20:15 +00:00
akr 6c0e64dee5 * ext/socket/lib/socket.rb: fix argument check in the previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-10 14:04:23 +00:00
akr 5515afbf8f * ext/socket/lib/socket.rb (Socket.tcp): add :connect_timeout option.
(Addrinfo#connect_from): add :timeout option.
  (Addrinfo#connect): ditto.
  (Addrinfo#connect_to): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-10 13:13:57 +00:00
nagachika 0bd01d0058 * ext/date/date_parse.c (date_zone_to_diff): add RB_GC_GUARD.
[ruby-dev:44337] [Bug #5152]

* ext/date/data_parse.c (parse_ddd_cb): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09 14:00:49 +00:00
ngoto 4d71d34855 * ext/fiddle/conversions.c (generic_to_value): ffi_arg and ffi_sarg
should be used to handle shorter return value. fix [Bug #3861]
  [ruby-core:32504]
* ext/fiddle/closure.c (callback): ditto
* ext/fiddle/conversions.h (fiddle_generic): ditto
* ext/fiddle/conversions.c (value_to_generic): char, short and int
  are strictly distinguished on big-endian CPU, e.g. sparc64.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09 05:31:47 +00:00
drbrain 88cff367f4 * ext/zlib/zlib.c (gzfile_wrap): Document encoding options.
* ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
	* ext/zlib/zlib.c (rb_gzreader_s_open): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09 00:18:18 +00:00
kosaki 9c760d0aad * ext/openssl/ossl_asn1.c (decode_eoc): remove unused variables.
Patch by Eric Wong. [Feature #5157] [ruby-core:38798]
* ext/openssl/ossl_asn1.c (ossl_asn1_decode): ditto.
* ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-07 13:52:36 +00:00
naruse 937ff7bdeb * ext/digest/sha2/sha2ossl.c: use original SHA384_Final on DragonFly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-07 06:38:36 +00:00
ktsj bc647cbdfb * ext/objspace/objspace.c: fix typos in a document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-07 05:13:02 +00:00
naruse dd6911a8c8 * ext/tk/lib/tk/wm.rb (Tk::Wm.command): Add the missing receiver
before calling epath. patched by flori
  aa9474d32e

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-06 15:44:06 +00:00
nobu 1c647cc203 * ext/psych/psych.gemspec (files): remove extra commas.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04 07:09:58 +00:00
tenderlove 92f3904534 oops, fix author in the psych gemspec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 18:08:48 +00:00
tenderlove 55d68f1160 installing psych as a gem
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 17:02:44 +00:00
usa f9e9eee677 * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
[Bug #5153] [ruby-core:38736]

* io.c (argf_next_argv): remove the call of above function.

* ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
  extension module because this is only for testsing ruby_add_suffix().

* LEGAL: remove the mention about a part of util.c, because now we
  removed the part.

* io.c (argf_next_argv): now the new filename is not guranteed to
  use, so should check the return value of rename(2).

* test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
  now we expect same result with other platforms on no_safe_rename
  platforms (=Windows).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 07:10:56 +00:00
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