Commit graph

42330 commits

Author SHA1 Message Date
nagachika
a7314a73eb merge revision(s) 57187,57234: [Backport #13075]
pack.c: avoid returning uninitialized String

	Fix unpacking with 'b', 'B', 'h' and 'H' format. Do not return an
	uninitialized String to Ruby before filling the content bytes.
	Fixes r11175 ("pack.c (pack_unpack): execute block if given with
	unpacked value instead of creating an array", 2006-10-15).
	[ruby-core:78841] [Bug #13075]
	test/ruby/test_pack.rb: fix test case added by r57187

	The test case for String#unpack added by r57187 is not properly testing
	because the String will be filled after the block invocation.
	[ruby-core:78841] [Bug #13075]

	Thanks to nagachika for pointing this out:

	  http://d.hatena.ne.jp/nagachika/20161226/ruby_trunk_changes_57184_57194#r57187

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:13:23 +00:00
nagachika
8f3cf2cc09 merge revision(s) 57027: [Backport #13012]
ruby-lex.rb: fix for label

	* lib/irb/ruby-lex.rb (identify_identifier): treat identifier just
	  followed by a colon as a lable.  this is not a precise solution
	  but enough for the time being.  [ruby-core:78526] [Bug #13012]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:09:31 +00:00
nagachika
6920c438d6 merge revision(s) 58008: [Backport #9294]
io.c: improve docs

	* io.c: [DOC] improve and harmonize docs for IO#read and ARGF#read;
	  fix invalid example code for IO#read to make it syntax highlighted.

	* io.c: [DOC] various improvements for docs of IO, ARGF, and Kernel:
	  fix indent to ensure correct code block detection; sync "outbuf"
	  paragraph for {IO,ARGF}#read, {IO,ARGF}#readpartial, and IO#sysread;
	  fix formatting of call-seq's; improve Kernel#open example to use nil?;
	  fix RDoc markup and typos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:08:31 +00:00
nagachika
022584fb70 merge revision(s) 57780: [Backport #12975]
docs for IO#print

	* io.c: [DOC] split documentation for IO#print into smaller paragraphs,
	  delete duplicate sentence, fix call-seq.
	  Based on a patch by Dario Daic. [ruby-core:78291] [Bug #12975]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:06:10 +00:00
nagachika
ba81af97e9 merge revision(s) 57360: [Backport #12884]
class.c: non-keyword hash class

	* class.c (rb_extract_keywords): keep the class of non-keyword
	  elements hash as the original.  [ruby-core:77813] [Bug #12884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:05:01 +00:00
nagachika
0d399220b0 merge revision(s) 57278,57279: [Backport #12855]
fix optimization for hash aset/aref with fstring

	Patch by Eric Wong [ruby-core:78797].
	I don't like the idea of making insns.def any bigger to support
	a corner case, and "test_hash_aref_fstring_identity" shows
	how contrived this is.

	[ruby-core:78783] [Bug #12855]
	adjust indent [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:02:50 +00:00
nagachika
7cbc39be69 merge revision(s) 58057: [Backport #13353]
stringio.c: RB_INTEGER_TYPE_P

	* ext/stringio/stringio.c (RB_INTEGER_TYPE_P): fallback definition
	  for 2.3 or earlier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:51:02 +00:00
nagachika
715f997ab7 merge revision(s) 57492: [Backport #12405]
test_queue.rb: fix portability

	* test/thread/test_queue.rb (test_queue_with_trap): fix
	  portability.  use SIGINT instead of SIGUSR2 which is supported
	  on not all platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:49:01 +00:00
nagachika
8dbfd4b86c merge revision(s) 58037: [Backport #10944]
docs for creating arrays

	* array.c: [DOC] add example for Array.new with block and index.
	  Reported by Don Cruickshank.  [ruby-core:68442] [Bug #10944]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:43:35 +00:00
nagachika
64cf9f1153 merge revision(s) 56310: [Backport #13364]
* win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
	  errno internally, then should not set it here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:38:52 +00:00
nagachika
e3defadb78 merge revision(s) 58077: [Backport #13358]
ostruct.rb: fix OpenStruct.allocate

	* lib/ostruct.rb (OpenStruct.allocate): initialize an instance
	  variable directly, without calling `intialize` method which may
	  be overridden in a subclass.  [ruby-core:80292] [Bug #13358]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:37:55 +00:00
nagachika
5194682b72 merge revision(s) 58040,58041: [Backport #13353]
stringio.c: check character code

	* ext/stringio/stringio.c (strio_ungetc): check if the character
	  code is valid in the encoding.  reported by Ahmad Sherif
	  (ahmadsherif) at https://hackerone.com/reports/209593.
	stringio.c: check range

	* ext/stringio/stringio.c (strio_ungetc): raise RangeError instead
	  of TypeError at too big value, as well as IO#ungetc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:35:54 +00:00
nagachika
18e641dc13 merge revision(s) 57546: [Backport #13194]
rbinstall.rb: Gem::Installer lacks dir_mode option

	* tool/rbinstall.rb (bundle-gems): Gem::Installer does not support
	  directory permission option, set umask to owner writable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:18:38 +00:00
svn
1ba14687d9 * 2017-03-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:08:55 +00:00
nagachika
018eeaf276 merge revision(s) 56747,56754,56777: [Backport #12923] [Backport #12930] [Backport #13238]
class.c: no fstring singleton class

	* class.c (singleton_class_of): prohibit fstrings from creating
	  singleton classes.
	  temporary measure for [ruby-dev:49867] [Bug #12923]
	test_fstring.rb: fix exception

	* test/-ext-/string/test_fstring.rb (test_singleton_class): fix
	  expected exception class.  [ruby-dev:49867] [Bug #12923]
	vm_eval.c: fstring instance_eval

	* vm_eval.c (singleton_class_for_eval): enable fstring singleton
	  class for instance_eval.  [ruby-core:78116] [Bug #12930]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 15:08:54 +00:00
nagachika
783286fe56 merge revision(s) 57584: [Backport #13202]
[DOC] Update an obsolete example for slice_before.

	The argument for Enumerable#slice_before is is removed at Ruby 2.3.

	Reported by Shyouhei Urabe.  [Bug #13202]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 14:49:42 +00:00
nagachika
57d0c36a28 merge revision(s) 57972: [Backport #13198]
Fix bug of Tempfile#size if nothing is written [Bug #13198]

	* lib/tempfile.rb (Tempfile#size): Fix its behavior when nothing
	  is written. Tempfile#size should return 0 in this case.
	  The patch is from nobu <nobu@ruby-lang.org>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 14:47:38 +00:00
nagachika
316f37b187 merge revision(s) 53667,57735: [Backport #13148]
hash.c: exception examples

	* hash.c (rb_hash_dig): [DOC] add examples of exceptions.
	Fix doc for Hash#dig and Struct#dig

	* hash.c (rb_hash_dig): [DOC] correct argument name
	  in method description; fix formatting in examples.
	* struct.c (rb_struct_dig): ditto.

	[ruby-core:79221] [Bug #13148]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 14:46:22 +00:00
nagachika
8231f5f706 merge revision(s) 57543: [Backport #13194]
rbinstall.rb: default umask

	* tool/rbinstall.rb: revert r49841 and default umask to just
	  prohibit all from writing.  symlink(2) has no argument to set
	  permissions but is affected by umask.
	  [ruby-dev:49975] [Bug #13194]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 14:37:54 +00:00
nagachika
e0cb040a9b merge revision(s) 57280,57282: [Backport #13112]
console.c: OOB access

	* ext/io/console/console.c (console_set_winsize): fix
	  out-of-bounds access.  [ruby-core:79004] [Bug #13112]
	console.c: unpaired size

	* ext/io/console/console.c (console_set_winsize): reject unpaired
	  pixel size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 14:35:49 +00:00
nagachika
62a02670ec merge revision(s) 57121: [Backport #13053]
array.c: do not resize to less than 0

	Shrinking the Array from the block invoked by Array#select! or
	Array#reject! causes the Array to be a negative number size. Ensure that
	the resulting Array won't be smaller than 0.
	[ruby-core:78739] [Bug #13053]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 12:26:59 +00:00
nagachika
f8f026c4d6 merge revision(s) 56592: [Backport #11964]
* eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c:
	  TracePoint#method_id should return method_id, not callee_id.
	  [ruby-core:77241] [Feature #12747]

	* test/ruby/test_settracefunc.rb: change accordingly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 11:25:19 +00:00
nagachika
4919dbabdb merge revision(s) 56139,57066,57099,57100: [Backport #10774]
* lib/uri/mailto.rb: Removed needless `return` and use `.`` instead of `::`
	  with class method.

	* test/uri/test_mailto.rb: Added tests for coverage.

	Use URI.decode_www_form_component [Bug #10774]

	`parser` refered RFC2396_Parser, but it is separated.
	test is contributed by Dominik Menke
	test_mailto.rb: adjust scope
	test_mailto.rb: overwritten methods

	* test/uri/test_mailto.rb (URI::TestMailTo#test_to_mailtext):
	  merge overwritten methods.  [Bug #10774]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 11:13:31 +00:00
nagachika
ddd7dd0f8c merge revision(s) 56020,57717: [Backport #13253]
parse.y: heredoc token

	* parse.y (parser_heredoc_identifier): gather branches by quote
	  char.
	parse.y: indent at invalid identifier

	* parse.y (parser_heredoc_identifier): set indent only when valid
	  identifier, not to dedent non-existent contents later.
	  [ruby-core:79772] [Bug #13253]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 14:26:42 +00:00
nagachika
10e0fc1b6c merge revision(s) 57688,57689: [Backport #13242]
rational.c: infinity in power

	* rational.c (nurat_expt): return Infinity due to overflow.
	  [ruby-core:79686] [Bug #13242]:
	rational.c: infinity in power

	* rational.c (nurat_expt): return 0 due to overflow.
	  [ruby-core:79686] [Bug #13242]:

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 14:13:40 +00:00
nagachika
b866e34f75 merge revision(s) 57199,57202,57206,57224: [Backport #13076]
io.c: fix race between read and close

	* io.c (io_fillbuf): fix race between read and close, in the case
	  the IO gets closed before the reading thread achieve the lock.
	  [ruby-core:78845] [Bug #13076]
	thread.c: fix race between read and close

	* thread.c (rb_thread_fd_close): wait until all threads using the
	  fd finish the operation, not to free the buffer in use.
	  [ruby-core:78845] [Bug #13076]
	revert a part of r57199

	* io.c (io_fillbuf): revert a part of r57199 because it broke IO#getch.
	  see also [Bug #13076]

	io.c: fix race between read and close

	* io.c (io_fillbuf): fix race between read and close and bail out
	  in the case the IO gets closed before the reading thread achieve
	  the lock.  [ruby-core:78845] [Bug #13076]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 14:01:06 +00:00
nagachika
4e1f1ec1a8 merge revision(s) 57024: [Backport #13015]
vm.c: check type of hash to merge

	* vm.c (core_hash_merge): check the type of the target hash to
	  merge.  [ruby-core:78536] [Bug #13015]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 13:46:12 +00:00
nagachika
e120cc91f0 merge revision(s) 57477,57478,57479: [Backport #12405]
use TRUE/FALSE.

	define rb_thread_sleep_deadly_allow_spurious_wakeup().

	* thread.c, thread_sync.c: define new function
	  rb_thread_sleep_deadly_allow_spurious_wakeup() and use it instead of
	  using sleep_forever() directly.

	allow Queue operation in trap.

	* thread_sync.c: allow spurious wakeup to check Queue status just after trap.
	  [Bug #12405]

	* test/thread/test_queue.rb: add a test for it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-20 12:26:14 +00:00
nagachika
26b9fb4711 merge revision(s) 57517: [Backport #13190]
doc: Fix error for escape sequences in string literals

	Backslash goes first in escape sequences, so it must be
	"any other character following a backslash is interpreted as ...",
	while the doc says "...followed by...".

	Author: Marcus Stollsteimer <sto.mar@web.de>
	[ruby-core:79418] [Bug #13190]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:48:03 +00:00
nagachika
6781722aa4 merge revision(s) 57522: [Backport #13189]
doc: restore class documentation for Struct

	* struct.c: restore class documentation for Struct
	  that disappeared with r46663.

	Due to r46663, the class documentation for Struct disappeared.
	(The revision inserted the definition of `InitVM_Struct` between
	the rdoc and the definition of `Init_Struct`.)

	The docs are rendered for 2.1: <https://docs.ruby-lang.org/en/2.1.0/Struct.html>,
	but not for later versions, see: <https://docs.ruby-lang.org/en/2.2.0/Struct.html>
	(Same for `ri` pages).

	[ruby-core:79416] [Bug #13189]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:46:37 +00:00
nagachika
b334883cc1 merge revision(s) 57434: [Backport #13161]
Enumerable#{min,min_by,max,max_by} [ci skip]

	* enum.c: [DOC] Enumerable#{min,min_by,max,max_by} return a sorted
	  array when +n+ argument is used.

	* enum.c: Small typo : minimum -> maximum

	[Bug #13161]
	Author:    Eric Duminil <eric.duminil@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:45:36 +00:00
nagachika
ce6fdd55bd merge revision(s) 54785: [Backport #11900]
* ruby.c (process_options): convert -e script to the encoding
	  given by a command line option on Windows.  assume it is the
	  expected encoding.  [ruby-dev:49461] [Bug #11900]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:43:39 +00:00
nagachika
0844dbdc37 merge revision(s) 57539: [Backport #11752]
rational.c: fix rdoc [ci skip]

	* rational.c (rb_rational_plus): [DOC] fix an example.
	  A patch by Trygve Flathen <at.ruby-lang AT flathen.net> in
	  [ruby-core:71755].  [Bug #11752]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:33:32 +00:00
nagachika
84ccd55abd merge revision(s) 57595: [Backport #8996]
check thread deadness correctly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:22:46 +00:00
nagachika
63818379aa merge revision(s) 56125,56150: [Backport #12741]
* thread.c (rb_threadptr_raise): set cause from the called thread,
	  but not from the thread to be interrupted.
	  [ruby-core:77222] [Bug #12741]

	* test/ruby/test_exception.rb: fix thread issues.
	  * use Queue instead of a local variable for synchronization.
	  * join created thread to soleve leaking threads warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 21:07:54 +00:00
nagachika
250fa1cbf0 merge revision(s) 57767,57944: [Backport #10403]
io.c: documentation for puts

	* io.c: [DOC] clarify that the 'record separator' between
	  arguments passed to 'puts' is always a newline.
	  Based on a patch by Mark Amery. [ruby-core:65801] [Misc #10403]
	io.c: [DOC] IO#puts uses IO#write

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 20:38:37 +00:00
nagachika
0f1e756310 revert r57571. merge revision(s) 55781,55783: [Backport #12604]
It breaked CI on vc12-x64
20170207T182419Z.log.html.gz



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-14 09:56:33 +00:00
nagachika
8e25d6456c merge revision(s) 57368: [Backport #12613]
compile.c: check err_info

	* compile.c (iseq_setup): bail out if any errors found.
  [ruby-core:76531] [Bug #12613]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 17:39:54 +00:00
nagachika
c59b391332 merge revision(s) 55781,55783: [Backport #12604]
* ext/win32/resolv/resolv.c (get_dns_server_list): [Win32] get DNS
	  servers only for connected network devices by GetNetworkParams
	  API.  [Bug #12604]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 17:28:57 +00:00
nagachika
1034b6d23d merge revision(s) 53383,55366: [Backport #12478]
* lib/forwardable.rb (def_instance_delegator): adjust backtrace of
	  method body by tail call optimization.  adjusting the delegated
	  target is still done by deleting backtrace.

	* lib/forwardable.rb (def_single_delegator): ditto.

	* lib/forwardable.rb (Forwardable._delegator_method): extract
	  method generator and deal with non-module objects.
	  [ruby-dev:49656] [Bug #12478]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 17:18:46 +00:00
nagachika
161f08ba0d merge revision(s) 57123: [Backport #13054]
re.c: consider the case of RMatch::regexp is nil

	Follow r49675, r57098 and r57110. Don't assume RMatch::regexp always
	contains a valid Regexp instance; it will be Qnil if the MatchData is
	created by rb_backref_set_string().  [ruby-core:78741] [Bug #13054]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 17:02:32 +00:00
nagachika
13a55f431e merge revision(s) 56928: [Backport #12991]
thread.c: fix doc of abort_on_exception [ci skip]

	* thread.c (rb_thread_s_abort_exc, rb_thread_s_abort_exc_set):
  [DOC] the raised exception will be re-raised in the main thread,
  and then follows the ordinary exception sequence, exit status is
  not 0.  [ruby-core:78415] [Bug #12991]

	* thread.c (rb_thread_abort_exc_set): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 16:45:42 +00:00
nagachika
15fbd0aa9b merge revision(s) 57172: [Backport #13066]
time.c: fix type of usec2subsecx

	* time.c (usec2subsecx): fix return type, which is a numeric
  object but not a long int.  [ruby-dev:49912] [Bug #13066]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 16:44:32 +00:00
nagachika
24a5758001 merge revision(s) 56892: [Backport #12910]
test_fileutils.rb: fix deadlock

	* test/fileutils/test_fileutils.rb (assert_output_lines): ensure
  that write pipe is closed, not the reader thread to deadlock
  when an exception raised in the given block.
  [ruby-core:78053] [Bug #12910]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 16:42:32 +00:00
nagachika
7d3b03f9fe merge revision(s) 56224: [Backport #12785]
* test/misc/test_ruby_mode.rb (assert_indent): since write-region
	  in Emacs 25.1 no longer displays the "Wrote file" message, shows
	  the explicit message to check if successfully finished.
	  [ruby-core:77355] [Bug #12785]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 16:38:52 +00:00
nagachika
6ef99fec9f version.h: bump up patchlevel for r57356.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 11:14:06 +00:00
nagachika
a1709f1d15 win32/win32.c: fix r57351. rename PATH_MAX to MAX_PATH.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 11:13:28 +00:00
nagachika
565b6da190 merge revision(s) 57135,57136: [Backport #13058]
Fixed potentially buffer overrun.

	* win32/win32.c (winnt_stat): the return value of `get_final_path` is the
  expected buffer length, not the actuall filled length.

	* win32/win32.c (winnt_stat): `finalname` may be accessed in the outer block of
  its definition via `path`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-16 19:51:56 +00:00
nagachika
aa983c4ccb merge revision(s) 57119: [Backport #13052]
array.c: check array length every time after yielding

	Since the Array may be modified during rb_yield(), the length before
	invoking the block can't be trusted. Fix possible out-of-bounds read in
	Array#combination and Array#repeated_combination.

	It may better to make a defensive copy of the Array, but for now let's
	follow what Array#permutation does.  [ruby-core:78738] [Bug #13052]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-16 19:46:03 +00:00
nagachika
f6e44a2a5a merge revision(s) 57098: [Backport #13042]
re.c: non-regexp name reference

	* re.c (rb_reg_regsub): other than regexp has no name references.
  [ruby-core:78686] [Bug #13042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-16 19:34:52 +00:00