From: "nagachika (Tomoyuki Chikanaga)" Date: 2022-10-23T10:41:27+00:00 Subject: [ruby-core:110488] [Ruby master Bug#18909] ARGF.readlines reads more than current file Issue #18909 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE ruby_3_1 5e25ba5d07d42f02485235e3962a4a28373c50e1 merged revision(s) 280b805d040fa537d5a459b40d4bfa6d49700905. ---------------------------------------- Bug #18909: ARGF.readlines reads more than current file https://bugs.ruby-lang.org/issues/18909#change-99809 * Author: JohanJosefsson (Johan Josefsson) * Status: Closed * Priority: Normal * ruby -v: ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] * Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE ---------------------------------------- The docuentation says that ARGF.readlines: *Reads ARGF's current file in its entirety* , but this is what happens: `$ cat fileA A $ cat fileB B $ ruby -e 'puts ARGF.readlines' fileA fileB A B` i.e. it reads both the current file and the next one (all files?). -- https://bugs.ruby-lang.org/ Unsubscribe: