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

6130 Коммитов

Автор SHA1 Сообщение Дата
nobu 26bc97bda4 zlib.c: Fix typo [ci skip]
* ext/zlib/zlib.c (Init_zlib): [DOC] Fix double-word typo and
  grammatical error.  [Fix GH-1162]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-19 05:27:52 +00:00
nobu 3e1c01ae46 stringio.c: separate encoding from buffer
* ext/stringio/stringio.c (strio_set_encoding): add StringIO's own
  encoding and separate it from the buffer string to override the
  encoding of string when reading.  [ruby-core:72189] [Bug #11827]
  note that setting the encoding of its buffer string may cause
  unpredictable behavior.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 07:54:33 +00:00
nobu 21973c01ab stringio.c: strio_unget_bytes
* ext/stringio/stringio.c (strio_unget_bytes): extract from
  strio_ungetbyte to share with strio_ungetc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 06:40:00 +00:00
nobu b7d1536991 stringio.c: padding in ungetbyte
* ext/stringio/stringio.c (strio_ungetbyte): pad with \000 when
  the current position is after the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 03:09:16 +00:00
hsbt b1a658e827 * ext/pty/pty.c: fix double words typo.
[ci skip][fix GH-1157] Patch by @jwworth

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 00:44:52 +00:00
hsbt 7d8290811e * ext/nkf/nkf-utf8/utf8tbl.c: fix a typo.
[ci skip][fix GH-1159] Patch by @akshay-vishnoi
* ext/nkf/nkf-utf8/utf8tbl.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 00:42:49 +00:00
nagachika 79c7a51893 * ext/fiddle/handle.c: check tainted string arguments.
Patch provided by tenderlove and nobu.

* test/fiddle/test_handle.rb (class TestHandle): add test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 12:08:49 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
hsbt 79a6daa394 * ext/zlib/zlib.c: fix a typo.
[ci skip][fix GH-1149] Patch by @crismali

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 02:55:13 +00:00
hsbt 059c9c1cf3 * ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz
* lib/drb/extservm.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/http/response.rb: ditto.
* lib/scanf.rb: ditto.
* lib/uri/generic.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 08:05:35 +00:00
nobu 4977af3c3d function.c: fix typo
* ext/fiddle/function.c (initialize): fix typo "ary" to "args",
  and adjust type of variables to suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 10:57:51 +00:00
usa de577357e8 * ext/fiddle/function.c: fix build error introduced at r53082.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 10:25:01 +00:00
nobu bcc2421b49 function.c: check arguments
* ext/fiddle/function.c (initialize): check all arguments first.
  reported by Marcin 'Icewall' Noga of Cisco Talos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:35:58 +00:00
nobu 34a0df159b conversions.h: PTR2NUM
* ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
  Fixnum for negative values.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:35:10 +00:00
nobu db48c30794 psych_emitter.c: check tags range
* ext/psych/psych_emitter.c (start_document): should not exceed
  tags array range.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:28:51 +00:00
nobu cc03134361 psych_emitter.c: check string
* ext/psych/psych_emitter.c (start_document): ensure string before
  encoding conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:27:52 +00:00
nobu cdaa94eab4 tkutil.c: check arg
* ext/tk/tkutil/tkutil.c (tk_hash_kv): check types of array
  argument.  reported by Marcin 'Icewall' Noga of Cisco Talos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:26:30 +00:00
nobu 62539b49a7 tkutil.c: array length
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check length of
  argument arrays for each access, as callback methods can modify
  them.  reported by Marcin 'Icewall' Noga of Cisco Talos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:25:15 +00:00
nobu b2d3c6a86f tkutil.c: check args
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check types of
  argument elements.  reported by Marcin 'Icewall' Noga of Cisco
  Talos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:23:36 +00:00
nobu 739d9a37cb win32ole.c: check argument type
* ext/win32ole/win32ole.c (ole_vstr2wc): check argument type, vstr
  must be a String here.  reported by Marcin 'Icewall' Noga of
  Cisco Talos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:19:20 +00:00
naruse 1dd1a9873e * ext/openssl/ossl_ssl.c (ssl_npn_select_cb_common): fix parsing
protocol list.
  The protocol list from OpenSSL is not null-terminated.
  patched by Kazuki Yamaguchi [Bug #11810] [ruby-core:72082]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 01:29:44 +00:00
naruse 7fe3c2665e * ext/nkf/nkf-utf8/nkf.c: Merge nkf 2.1.4.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-12 14:01:56 +00:00
normal a26d09da85 NEWS: add note about Fiddle GVL release
* NEWS: note Fiddle GVL release [Feature #11607]
* ext/fiddle/function.c (Init_fiddle_function): document above, too

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-11 07:43:09 +00:00
hsbt 567eb15df3 * ext/tk/lib/multi-tk.rb: fix typos.
[Bug #11764][ruby-core:71800]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-10 05:13:39 +00:00
normal 10735e2d03 ext/socket/ifaddr.c: remove empty ifaddr_mark
We do not need to maintain empty functions for GC,
gc_mark_children will not attempt to dereference NULL
dmark callbacks.

* ext/socket/ifaddr.c (ifaddr_mark): remove empty function
  (ifaddr_type): pass zero to rb_data_type_t.function.dmark

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09 20:07:23 +00:00
nobu 0d89c6db7e stringio.c: unused variable
* ext/stringio/stringio.c (strio_memsize): remove a variable which
  is no longer used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09 02:43:55 +00:00
ko1 dff42b0ea0 * ext/**/*.c (*_memsize): same as r52986 for extensions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09 01:01:17 +00:00
nobu 8f620b9b17 retry IO#getpass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 13:26:56 +00:00
naruse 958e153cdb Revert r52902,r52903,r52910,r52911,r52937,r52939
Reject IO::Console#getpass because it can't test portablly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 10:54:42 +00:00
nobu 1fadd43881 marshal.c: skip internal names
* marshal.c (w_objivar): skip internal instance variables in
  T_OBJECT too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 05:20:41 +00:00
nobu 08753137de date_core.c: missing argument check
* ext/date/date_core.c (d_lite_lshift): should check the argument
  before negation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 00:03:21 +00:00
normal 889f50227c socket: expand docs+tests for recv_io/send_io
* ext/socket/unixsocket.c (unix_send_io): document args
  (unix_recv_io): ditto
* test/socket/test_unix.rb (test_fd_passing_class_mode): added

I was working on these when I encountered the problem in
with BasicSocket.for_fd not handling mode args:
https://bugs.ruby-lang.org/issues/11778

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 18:39:47 +00:00
tenderlove a34e45fd54 * ext/psych/*: update psych to 2.0.16
* test/psych/*: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 16:58:10 +00:00
nobu 9a28a29b87 parse.y: indented hereoc
* parse.y: add heredoc <<~ syntax.  [Feature #9098]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 14:39:52 +00:00
nobu 1ad0d8ecad console.c: prompt to stderr
* ext/io/console/console.c (console_getpass): print prompt to
  stderr when reading from stdin.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 06:30:11 +00:00
nobu 187de9240a console.c: console_getpass
* ext/io/console/console.c (console_getpass): add IO#getpass
  method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 06:25:10 +00:00
hsbt 1f1e3d1297 * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
upstream changes.
  4d059bf9f5
  d4c99de789
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 23:40:24 +00:00
hsbt d1decf0dfe * ext/bigdecimal/bigdecimal.c: Fix double word typo.
[ci skip][fix GH-1120] Patch by @jwworth

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-02 01:36:30 +00:00
normal ebcefd795b ext/openssl/ossl_ssl.c: hide globals
* ext/openssl/ossl_ssl.c (mSSLExtConfig): make static
  (eSSLError): ditto
  (ID_callback_state): ditto
  (ossl_ssl_ex_vcb_idx): ditto
  (ossl_ssl_ex_store_p): ditto
  (ossl_ssl_ex_ptr_idx): ditto
* ext/openssl/ossl_ssl.h: remove extern declarations for
  mSSLExtConfig and eSSLError

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 22:49:05 +00:00
nobu 41cbb7f050 cstr.c: split bug_str_cstr_unterm
* ext/-test-/string/cstr.c (bug_str_cstr_unterm): split
  unterminating from bug_str_cstr_term.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 08:09:17 +00:00
kosaki 07083767e9 * ext/openssl/ossl_rand.c (ossl_rand_bytes): RAND_bytes could
be return -1 as an error. Therefore, added error handling.
* ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:29:02 +00:00
naruse 6db72c0166 * ext/readline/extconf.rb: call dir_config("libedit")
if --enable-libedit is spcified. [Bug #11751]
  patched by John Hein

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 09:48:24 +00:00
nobu ef44c0ad2f ripper/lexer.rb: dispatch alias
* ext/ripper/lib/ripper/lexer.rb: alias same methods instead of
  eval for each events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 06:56:23 +00:00
nobu cf2b422fc5 ripper/core.rb: share handlers
* ext/ripper/lib/ripper/sexp.rb (SexpBuilderPP): share scanner
  event handlers and most of parser event handlers with
  SexpBuilder.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 05:43:17 +00:00
nobu f8ecb823a0 ripper/core.rb: dispatch alias
* ext/ripper/lib/ripper/core.rb: alias same methods instead of
  eval for each events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 05:26:16 +00:00
naruse 360b98355e fixup! r52695
OpenSSL's SHA1 struct name is SHA_CTX (which is also used for SHA-0),
but function name is SHA1_Transform.
http://openssl.org/docs/man0.9.8/crypto/SHA1.html

also note that LibreSSL 2.3 remove the SHA-0 support but still support SHA-1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 08:31:12 +00:00
nobu 13a935b0ba Drop support for BeOS
* beos: Drop support for BeOS now that Haiku is stable.
  [Fix GH-1112]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-24 00:17:11 +00:00
normal d51743afc8 ext/socket/init.c (rsock_accept): handle ENOMEM
accept(2) documents ENOMEM as a possible error, handle it
consistent with all of our other FD-allocating wrappers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 22:57:29 +00:00
normal 61e5fe0674 use rb_gc_for_fd for more callers
* dir.c (dir_initialize): use rb_gc_for_fd for ENOMEM
* ext/socket/init.c (rsock_socket): ditto
* ext/socket/socket.c (rsock_socketpair): ditto
* internal.h (rb_gc_for_fd): prototype
* io.c (rb_gc_for_fd): remove static
  [ruby-core:71623] [Feature #11727]

Manpages for opendir(2), socket(2), and socketpair(3posix)
describe ENOMEM as a possible error for each of these;
handle it consistently with our existing wrappers for
open(2)/pipe(2) etc...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 22:50:53 +00:00
normal 15476c695d fiddle: release GVL for ffi_call
Some external functions I wish to call may take a long time
and unnecessarily block other threads.  This may lead to performance
regressions for fast functions as releasing/acquiring the GVL is not
cheap, but can improve performance for long-running functions
in multi-threaded applications.

This also means we must reacquire the GVL when calling Ruby-defined
callbacks for Fiddle::Closure, meaning we must detect whether the
current thread has the GVL by exporting ruby_thread_has_gvl_p
in internal.h

* ext/fiddle/function.c (struct nogvl_ffi_call_args):
  new struct for GVL release
  (nogvl_ffi_call): new function
  (function_call): adjust for GVL release
  [ruby-core:71642] [Feature #11607]
* ext/fiddle/closure.c (struct callback_args):
  new struct for GVL acquire
  (with_gvl_callback): adjusted original callback function
  (callback): wrapper for conditional GVL acquire
* ext/fiddle/depend: add dependencies
* ext/fiddle/extconf.rb: include top_srcdir for internal.h
* internal.h (ruby_thread_has_gvl_p): expose for fiddle
* vm_core.h (ruby_thread_has_gvl_p): moved to internal.h
* test/fiddle/test_function.rb (test_nogvl_poll): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 21:20:56 +00:00