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

4387 Коммитов

Автор SHA1 Сообщение Дата
naruse 57657a0b9b suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 07:08:47 +00:00
nobu b4288080e7 * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
and intptr_t.  [ruby-core:42460][Feature #5992]
* ext/fiddle/fiddle.c (Init_fiddle): ditto.
* ext/dl/lib/dl/cparser.rb (DL::CParser#parse_ctype): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 05:47:16 +00:00
akr d9adb03dd9 * ext/curses/curses.c (Init_curses): use rb_define_const once for
Curses::VERSION.

* ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 02:09:22 +00:00
akr aa281e7517 * ext/curses/curses.c (Init_curses): make Curses::VERSION
understandable without context.

* ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 01:36:33 +00:00
tenderlove 0d1c8fd9d6 * ext/psych/parser.c: prevent a memory leak by protecting calls to
handler callbacks.
* test/psych/test_parser.rb: test to demonstrate leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24 04:55:33 +00:00
tenderlove 774cf315e8 * ext/psych/parser.c: set parser encoding based on the YAML input
rather than user configuration.
* test/psych/test_encoding.rb: corresponding tests.
* test/psych/test_parser.rb: ditto
* test/psych/test_tainted.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 23:12:57 +00:00
akr 427035c0bb add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 15:22:06 +00:00
akr cd390b1ec5 * ext/dbm/extconf.rb: unused macro removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 14:02:01 +00:00
akr a49fc9beb6 * ext/curses/rain.rb: trap SIGHUP, SIGINT, SIGQUIT and SIGTERM only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 10:59:00 +00:00
akr fd2e0e3dac * ext/dbm/extconf.rb: use DBM_SUFFIX only to detect header of
Berkeley DB.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 03:23:40 +00:00
akr 01433e4d53 * ext/curses/curses.c: use defined() to suppress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22 12:46:44 +00:00
akr 7c80d15165 * ext/curses/extconf.rb: refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22 12:45:04 +00:00
akr c01d52e8d9 * ext/curses/extconf.rb: try to distinguish curses_version is a
function or variable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22 11:44:26 +00:00
akr fa65fc9aeb * ext/curses/extconf.rb: show the chosen header and library.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22 10:48:59 +00:00
akr 9fc31792ce * ext/curses/extconf.rb: refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22 10:09:31 +00:00
akr 8963f50f26 * ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.
Its ndbm.h doesn't include db.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21 21:13:52 +00:00
akr eac1d9cfca * ext/dbm/dbm.c (fdbm_initialize): disable Berkeley DB error messages.
* ext/dbm/extconf.rb: check DBC type for above.

[ruby-dev:45269]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21 21:04:04 +00:00
akr 25df75e119 * ext/curses/curses.c (Init_curses): use curses_version() for
Curses::VERSION.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21 10:40:20 +00:00
akr a1292c72ef update comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 15:00:35 +00:00
akr b17bc95400 * ext/curses/extconf.rb: fold too long lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 12:41:23 +00:00
akr 83f742f86f * ext/curses/curses.c (Init_curses): define Curses::VERSION.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 12:10:00 +00:00
akr 9f6f0788d2 * ext/curses/extconf.rb: restore $libs and $defs for each
header/library choice.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 12:09:25 +00:00
akr faf4c9db80 * ext/dbm/extconf.rb: weaken header/library consistency check if db is
"ndbm".  It seems several (possibly historical) distributions
  provide libndbm.  However the content of libndbm vary: Berkeley DB,
  GDBM or even 4.3BSD NDBM.  (Mandriva, Tru64 UNIX, OpenSuSE,
  SCO OpenServer, ...)
  "ndbm" is not searched automatically now (dblib doesn't contain it)
  but configure --with-dbm-type=ndbm choose libndbm and ndbm.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 11:05:31 +00:00
akr f8015c23c4 * ext/dbm/extconf.rb: refine variable names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 10:16:25 +00:00
akr d7bf156afd * ext/dbm/extconf.rb: show header and library found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-19 14:44:24 +00:00
akr 95f3f9829f * ext/dbm/dbm.c (Init_dbm): refine DBM::VERSION definition.
* ext/dbm/extconf.rb: provide RUBYDBM_GDBM_HEADER macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-19 14:02:14 +00:00
akr 0187905af2 * ext/dbm/extconf.rb: detect GDBM's ndbm.h by testing dbm_clearerr is
an empty macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 16:06:52 +00:00
akr fcd8f78ea3 * ext/dbm/extconf.rb: don't choose 'dbm' if _GDB_H_ is defined which
is available since GDBM 1.9 because 'gdbm_compat' is appropriate
  choise since GDBM 1.8.1.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 15:31:09 +00:00
akr fc0111cce1 * ext/dbm/extconf.rb (dblib): prefer recent GDBM over older GDBM.
(have_declared_libvar): new function to check a declared variable
  exists in a library.
  (have_undeclared_libvar): renamed from renamed from have_libvar.
  (headers.db_check2): check that GDBM version variable if GDBM header
  is choosen.

* ext/dbm/dbm.c (Init_dbm): use HAVE_DECLARED_LIBVAR_GDBM_VERSION and
  HAVE_UNDECLARED_LIBVAR_GDBM_VERSION macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 09:47:07 +00:00
akr e7a1d4a309 * ext/dbm/dbm.c (DBM::VERSION): define it by detecting _GDBM_H_ or
_DBM_IOERR.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 03:51:52 +00:00
akr 92e7c2d3ea * ext/dbm/extconf.rb: remove dbm.
forgotten in r34666.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 12:41:54 +00:00
akr 6d1f751207 * ext/dbm/extconf.rb: refine header/libraty mismatch detection.
check only for ndbm.h except libc.  check _GDBM_H_ for gdbm.
  check _DBM_IOERR for the original ndbm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 12:29:50 +00:00
akr fbca1d0da1 * ext/dbm/extconf.rb: don't check libdbm. It is not a ndbm
implementation.  (libdbm in Version 7 Unix is database library
  for single database per process.)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 12:10:32 +00:00
akr 2f92a267f4 * ext/dbm/extconf.rb: refactored to split too long conditions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-16 22:32:10 +00:00
akr 078b3cf95e * ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
Berkeley DB library.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-16 15:05:46 +00:00
nobu 34be46a32e * ext/fiddle/closure.c (callback): deal with unsinged integers.
[ruby-core:42458][Bug #5991][Bug #6022]
* ext/fiddle/conversions.c (value_to_generic, generic_to_value):
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 10:57:05 +00:00
nobu fa65df0d08 * ext/fiddle/closure.c (callback): same as r34506.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 10:52:31 +00:00
drbrain b6c604d757 * ext/zlib/zlib.c (Init_zlib): Added Zlib::TEXT and note that
Zlib::ASCII is deprecated in zlib 1.2.3 and newer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 04:30:37 +00:00
drbrain 72282ab1e2 * ext/zlib/zlib.c: Move constant descriptions to constants. Remove
extra comment block at the top of Init_zlib().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 04:25:11 +00:00
drbrain 623169a5c6 * ext/zlib/zlib.c (Init_zlib): Added Zlib::FIXED and Zlib::RLE
strategies.
* NEWS:  Add note about the new Zlib constants.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 01:28:05 +00:00
drbrain b52693b5a8 * ext/zlib/zlib.c: Improve documentation. [ruby-trunk - Bug #5948]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 01:12:08 +00:00
akr f119915f51 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11 12:05:57 +00:00
drbrain 1516f8eb9f * ext/zlib/zlib.c (rb_inflate_add_dictionary): Added
Zlib::Inflate#add_dictionary to allow users to pre-specify
  for using during #inflate.  [ruby-trunk - Feature #5937]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11 00:37:44 +00:00
drbrain 403dc5357d * ext/zlib/zlib.c (do_inflate): Inflate more data if buffered data
exists.  Allows Zlib::Inflate#set_dictionary to work.
  [ruby-trunk - Bug #5929]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11 00:29:52 +00:00
tenderlove 59a1344808 * ext/psych/parser.c: removed external encoding setter, allow parser
to be reused.
* ext/psych/lib/psych/parser.rb: added external encoding setter.
* test/psych/test_parser.rb: test parser reuse

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 18:44:27 +00:00
nobu 14c97cf9b6 * ext/dl/extconf.rb: clang does not use -fno-defer-pop during compilation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 16:41:08 +00:00
nobu 96ab37015e * ext/dl/dl.h (ALIGN_OF): use offsetof().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 16:30:43 +00:00
nobu 196151158f * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 16:29:08 +00:00
nobu d77b2387cf * ext/fiddle/fiddle.c (Init_fiddle): declare in modern style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 15:15:57 +00:00
nobu f90f02ab20 * ext/dl/dl.c (Init_dl): fix mangled documnet.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 07:48:22 +00:00
usa b2ba3242ea * ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
currenly pack/unpack does not accept "q!" and "Q!".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 07:10:26 +00:00
usa da098bd36e * ext/fiddle/conversions.c (value_to_generic): src is not guranteed as
a Bignum if the type is LONG_LONG.  it may be a Fixnum if the value
  is small.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 07:03:07 +00:00
nobu 57b2175207 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 03:25:07 +00:00
usa 70b504badb * ext/dl/lib/types.rb: Win64 support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 02:32:58 +00:00
nobu 83c7d9df2b * string.c (rb_str_modify_expand): fix memory leak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 13:30:04 +00:00
nahi 3ff2f9f3a3 * ext/openssl/ossl_ssl.c: Add SSL constants and allow to unset SSL
option to prevent BEAST attack. See [Bug #5353].

  In OpenSSL, OP_DONT_INSERT_EMPTY_FRAGMENTS is used to prevent
  TLS-CBC-IV vulunerability described at
  http://www.openssl.org/~bodo/tls-cbc.txt
  It's known issue of TLSv1/SSLv3 but it attracts lots of attention
  these days as BEAST attack. (CVE-2011-3389)

  Until now ossl sets OP_ALL at SSLContext allocation and call
  SSL_CTX_set_options at connection.  SSL_CTX_set_options updates the
  value by using |= so bits set by OP_ALL cannot be unset afterwards.

  This commit changes to call SSL_CTX_set_options only 1 time for each
  SSLContext. It sets the specified value if SSLContext#options= are
  called and sets OP_ALL if not.

  To help users to unset bits in OP_ALL, this commit also adds several
  constant to SSL such as
  OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.  These constants were
  not exposed in Ruby because there's no way to unset bits in OP_ALL
  before.

  Following is an example to enable 0/n split for BEAST prevention.

    ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS

* test/openssl/test_ssl.rb: Test above option exists.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 05:27:14 +00:00
emboss 45706e70c9 * ext/openssl/ossl_x509name.c: Use the numerical representation of
unrecognized OIDs instead of the sn "UNDEF".

* test/openssl/test_x509name.rb: Add tests for the fixed behavior.

  Patch provided by Paul Kehrer, thanḱ you!
  [ruby-core:41769] [Feature #5787]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 04:19:33 +00:00
emboss 460c8907c9 * ext/openssl/ossl_asn1.c: Call INT2NUM only once for GeneralString.
Thanks to Mantas Mikulenas for noticing and providing a patch!
  [ruby-core:42358] [Bug #5972]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 01:03:16 +00:00
emboss aa3854e33d * ext/openssl/ossl_cipher.c: Add warning about key as IV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 00:29:26 +00:00
nobu cf1a22fdf9 * st.c (st_update): table can be unpacked in the callback.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-07 05:52:15 +00:00
nobu af01b0fb07 * ext/-test-/st/numhash/numhash.c (numhash_alloc): free st_table.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-07 05:43:49 +00:00
nobu 97c3c98762 * st.c (st_foreach): should not yield same pair when checking
after unpacking.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-07 05:29:20 +00:00
drbrain 30f0e97ef0 * ext/openssl/ossl_x509store.c: Add class documentation for
OpenSSL::X509::Store


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-02 22:54:10 +00:00
akr 5525d82134 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-02 11:51:25 +00:00
nobu ef84b7c678 * ext/dl/cptr.c (rb_dlptr_new2): remove unused variable.
* ext/iconv/iconv.c (get_iconv_opt_i): ditto.

	* ext/syck/token.c (Plain): fix types on LP64.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-30 21:47:35 +00:00
nobu f3dabacefb * ext/readline/readline.c (readline_attempted_completion_function):
respect encodings.  [Bug #5941]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-29 03:18:11 +00:00
nobu 8335ce7065 * ext/io/console/console.c (io_getch): default delegating method
for StringIO.  https://github.com/nobu/io-console/issues/4
* ext/stringio/stringio.c: moved some methods to hidden modules.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25 18:24:09 +00:00
nobu ed469831e4 * file.c (rb_enc_path_next, rb_enc_path_skip_prefix)
(rb_enc_path_last_separator, rb_enc_path_end)
  (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
  path handling functions.
* file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
  (rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
  (rb_file_join): should respect the encodings of arguments than
  file system encoding.  [ruby-dev:45145] [Bug #5919]
* dir.c (check_dirname, ruby_glob0): ditto.
* ext/pathname/pathname.c (path_sub_ext): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25 02:32:06 +00:00
nobu 04726dd749 * vm.c (rb_iter_break_value): new function to break a block with
the value.  [ruby-dev:45132] [Feature #5895]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-24 05:20:48 +00:00
tadf 1d794b9335 ext/date/date_strptime.c: moved detector of leftover.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 22:54:09 +00:00
tadf 49d65bc4d6 ext/date/date_parse.c: [ruby-core:42173].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 22:13:10 +00:00
nobu d3b540cf40 * ext/curses/curses.c (cWindow, cMouseEvent): made typed data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 09:06:48 +00:00
tenderlove 8cf05741bc * ext/psych/lib/psych/visitors/to_ruby.rb: Added support for loading
subclasses of String with ivars
* ext/psych/lib/psych/visitors/yaml_tree.rb: Added support for dumping
  subclasses of String with ivars
* test/psych/test_string.rb: corresponding tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 03:52:01 +00:00
tenderlove ee3ebc2de5 * ext/psych/lib/psych/visitors/to_ruby.rb: Added ability to load array
subclasses with ivars.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Added ability to dump
  array subclasses with ivars.
* test/psych/test_array.rb: corresponding tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 01:44:21 +00:00
naruse c358a4cba1 * ext/json/parser/parser.rl (json_string_unescape): workaround fix
for over optimization of GCC 4.7. [ruby-core:42085] [Bug #5888]
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-15 06:52:36 +00:00
nobu 67bf09903f * ext/dl/callback/mkcallback.rb (gencallback): suppress unused
variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-14 13:24:12 +00:00
luislavena 44d20d61c7 Do not define _WIN32_WINNT multiple times
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-12 18:28:17 +00:00
shirosaki 9678dce5a4 * ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
use `extern __declspec(dllimport)` for dll link with VC.
  [ruby-core:41996] [Bug #5869]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10 13:21:54 +00:00
naruse b04814bf71 * ext/readline/readline.c (readline_attempted_completion_function):
use rb_memerror().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10 06:14:42 +00:00
naruse 56dc6f5acc * gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,
but should return pointer suitable for ruby_xfree;
  main vm and main thread.
  patched by Sokolov Yura. https://github.com/ruby/ruby/pull/79

* internal.h: ditto.

* vm.c (Init_BareVM): use ruby_mimmalloc.

* ext/dl/cfunc.c: #include <ruby/util.h>.

* ext/syslog/syslog.c: use xfree because it is allocated by
  ruby_strdup.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10 03:49:10 +00:00
kazu 107b713438 * ext/readline/readline.c (readline_attempted_completion_function): fix compile error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10 03:14:52 +00:00
nobu 9fa668f34a * ext/readline/readline.c (readline_attempted_completion_function):
empty completion result does not mean memory error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10 01:41:15 +00:00
nagachika 41889c5adc * ext/readline/readline.c (readline_attempted_completion_function):
fix typos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09 14:38:52 +00:00
akr afb5eef4e2 * ext/pathname/pathname.c (path_entries): add document suggested by
the thread [ruby-core:41959] [Bug #5859].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09 11:28:00 +00:00
akr bb1115a2d6 * ext/socket/lib/socket.rb (family_addrinfo): don't require protocol
equality.  For example, protocol 0 and IPPROTO_TCP is not problem
  for TCP.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09 11:18:00 +00:00
akr 268d1a2244 * ext/socket/lib/socket.rb (family_addrinfo): return the given
addrinfo object.
  Patch by Ippei Obayashi.  [ruby-dev:45095] [Bug #5845]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09 11:11:24 +00:00
akr a408b64c62 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09 05:09:57 +00:00
akr 5335b4b608 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09 04:02:08 +00:00
naruse 88b16cebc8 * gc.c (rb_objspace_free): global_List is allocated with xmalloc.
patched by Sokolov Yura.  https://github.com/ruby/ruby/pull/78

* dln_find.c: remove useless replacement of free.

* ext/readline/readline.c (readline_attempted_completion_function):
  strings for readline must allocated with malloc.

* process.c (run_exec_dup2): use free; see also r20950.

* re.c (onig_new_with_source): use malloc for oniguruma.

* vm.c (ruby_vm_destruct): use free for VMs.

* vm.c (thread_free): use free for threads.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08 21:02:08 +00:00
nobu 2f6d8bdc94 * st.c (st_update): new function to lookup the given key and
update the value.  [ruby-dev:44998]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-27 13:04:30 +00:00
emboss 7a9b2cad17 * ext/openssl/ossl_cipher.c: Fix more typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-25 20:47:48 +00:00
emboss 91785eca93 * ext/openssl/ossl_cipher.c: Fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-25 20:09:59 +00:00
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