merge revision(s) r45845,r45846,r45847: [Backport #9486]

	* parse.y (local_tbl_gen): remove local variables duplicated with
	  arguments.

	* parse.y (new_bv_gen): no duplicated names, if already added in
	  shadowing_lvar().
	  [ruby-core:60501] [Bug #9486]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46243,r46244: [Backport #9882] [Backport #9883]

	* string.c (rb_str_substr): need to reset code range for shared
	  string too, not only copied string.
	  [ruby-core:62842] [Bug #9882]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46598: [Backport #9991]

	* lib/webrick/utils.rb (create_listeners): Close socket objects.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r44535,r44536: [Backport #9321]

	* vm.c (rb_vm_pop_cfunc_frame): added.  It cares c_return event.
	  The patch base by drkaes (Stefan Kaes).
	  [Bug #9321]

	* variable.c (rb_mod_const_missing): use rb_vm_pop_cfunc_frame()
	  instead of rb_frame_pop().

	* vm_eval.c (raise_method_missing): ditto.

	* vm_eval.c (rb_iterate): ditto.

	* internal.h (rb_vm_pop_cfunc_frame): add decl.

	* test/ruby/test_settracefunc.rb: add tests.
	  provided by drkaes (Stefan Kaes).

	* vm.c, eval.c, include/ruby/intern.h (rb_frame_pop): 
	  move definition of rb_frame_pop() and deprecate it.
	  It doesn't care about `return' events.

	* vm.c, eval.c, include/ruby/intern.h (rb_frame_pop):


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46485: [Backport #9897]

	* ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
	  with 3-digit.  libffi 3.1 returns just 2-digit.
	  [ruby-core:62920] [Bug #9897]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r44505: [Backport #9994]

	numeric.c: isfinite

	* numeric.c (flo_is_finite_p): prefer C99 standard isfinite() than
  deprecated finite().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46098: [Backport #9861]

	* vsnprintf.c (BSD_vfprintf): fix string width when precision is
	  given.  as the result of `memchr` is NULL or its offset from the
	  start cannot exceed the size, the comparison was always false.
	  [ruby-core:62737] [Bug #9861]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45793: [Backport #9608]

	* complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
	  [Bug #9608]

	* rational.c (read_digits): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45863,r45871: [Backport #9750]

	* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#accept):
	  Consider Socket#accept as well as TCPServer#accept.
	  Reported by Sam Stelfox.  [ruby-core:62064] [Bug #9750]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45979: [Backport #9847]

	* io.c (io_setstrbuf): always check if the buffer is modifiable.
	  [ruby-core:62643] [Bug #9847]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46075: [Backport #9856]

	* process.c (proc_getgroups, proc_setgroups): use ALLOCV_N
	  [Bug #9856]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46233: [Backport #9878]

	* signal.c (ruby_signal): should return either `old.sa_sigaction`
	  or `old.sa_handler`, depending on whether `SA_SIGINFO` is set in
	  `old.sa_flags`, because they may not be a union.
	  [ruby-core:62836] [Bug #9878]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46331: [Backport #9885]

	* lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body
	  type as "MIXED" followed immediately by params
	  [ruby-core:62864] [Bug #9885]
	  Patch by @rayners (David Raynes). [Fixes GH-622] 
	  https://github.com/ruby/ruby/pull/622


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46457,r46458: [Backport #9949]

	* lib/net/ftp.rb (gets, readline): read lines without LF properly.
	  [ruby-core:63205] [Bug #9949]

	* test/net/ftp/test_buffered_socket.rb: related test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46342: [Backport #9954]

	* vm.c (core_hash_merge_kwd): should return the result hash, which
	  may be converted from and differ from the given argument.
	  [ruby-core:62921] [Bug #9898]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45399,r45400,r46036,r46037: [Backport #416]

	vm.c: merge code

	* vm.c (m_core_hash_from_ary, m_core_hash_merge_ary): merge
  duplicated code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r46360,r46372: [Backport #8625]

	* io.c (io_setstrbuf, io_read): should not shorten the given buffer until
	  read succeeds.  [ruby-core:55951] [Bug #8625]

	* io.c (read_all): truncate the buffer before appending read data,
	  instead of truncating before reading.
	  [ruby-core:55951] [Bug #8625]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45858,r45859,r45860,r45861,r46638: [Backport #9811]

	numeric.c: indent

	* numeric.c (ruby_num_interval_step_size): adjust indent.
	* numeric.c (num_step_scan_args): check keyword arguments and fail
	  if they conflict with positional arguments.
	  [ruby-dev:48177] [Bug #9811]

	* numeric.c (num_step_scan_args): table argument of rb_get_kwargs() is
	  array of IDs, not Symbols. [ruby-dev:48353] [Bug #9811]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45495: [Backport #9662]

	* README.EXT: fix typo.
  [ruby-core:61634] [Bug #9662]

	* README.EXT.ja: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) r45462,r45463,r45466: [Backport #9684]

	* struct.c (not_a_member): extract name error and use same error
	  messages.  based on the patch by Marcus Stollsteimer <sto.mar AT
	  web.de> at [ruby-core:61721].  [Bug #9684]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e