From: csaba@... Date: 2021-08-09T23:28:27+00:00 Subject: [ruby-core:104858] [Ruby master Bug#18074] ARGF.read(length) exhibits short rea Issue #18074 has been updated by csabahenk2 (Csaba Henk). Proposed fix: https://github.com/ruby/ruby/pull/4727 ---------------------------------------- Bug #18074: ARGF.read(length) exhibits short rea https://bugs.ruby-lang.org/issues/18074#change-93206 * Author: csabahenk2 (Csaba Henk) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0dev (2021-08-04T09:29:42Z master 6e55facdb3) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- If ruby is invoked with three file name arguments (which refer to extant non-empty regular files), and `ARFG.read` is called with a length argument that exceeds the combined size of the first two files[1], then only the content of the first two files will be collected in the resultant string. ``` shell $ for f in a b c; do echo -n $f > $f; done $ ruby -e 'p ARGF.read(3)' a b c "ab" ``` [1]: This is actually just a necessary condition, the exact criteria will be provided in followup analysis. -- https://bugs.ruby-lang.org/ Unsubscribe: