Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Chet Ramey
On 5/4/21 10:06 AM, Koichi Murase wrote: Let's take a step back. I think we can make the code simpler and still handle all the cases we need to. I don't think tape devices are worth worrying about. The issue with the BSDs and terminal devices is that the current code only checks for -1/ESPIPE,

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Chet Ramey
On 5/4/21 4:05 PM, Robert Elz wrote: Date:Tue, 4 May 2021 09:28:04 -0400 From:Chet Ramey Message-ID: | The issue with the BSDs and terminal devices is that the current code | only checks for -1/ESPIPE, but they return a different value for errno | (EINV

Bash-5.1 Official patch 7

2021-05-04 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.1 Patch-ID: bash51-007 Bug-Reported-by:Tom Tromey Bug-Reference-ID: <875z3u9fd0@tromey.com> Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-read

Bash-5.1 Official patch 8

2021-05-04 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.1 Patch-ID: bash51-008 Bug-Reported-by:Michael Felt Bug-Reference-ID: Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2021-03/msg00028.html B

Bash-5.1 Official patch 6

2021-05-04 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.1 Patch-ID: bash51-006 Bug-Reported-by:oguzismailuy...@gmail.com Bug-Reference-ID: Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2020-12/msg

Bash-5.1 Official patch 5

2021-05-04 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.1 Patch-ID: bash51-005 Bug-Reported-by:Alexander Mescheryakov , konsolebox Bug-Reference-ID: <5ffd7f3d.1c69fb81.dee25.1...@mx.google.com>

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Robert Elz
Date:Tue, 4 May 2021 09:28:04 -0400 From:Chet Ramey Message-ID: | The issue with the BSDs and terminal devices is that the current code | only checks for -1/ESPIPE, but they return a different value for errno | (EINVAL? I forget.) On traditional unix, since fo

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Koichi Murase
2021年5月4日(火) 22:28 Chet Ramey : > On 5/4/21 2:31 AM, Koichi Murase wrote: > > (1) Suggestion: use buffered read for a regular file for delim != '\n'? > > > >> It won't work on any system that doesn't return -1/ESPIPE when you try > >> to lseek on a terminal device. > > > > [...] > > > > lseek(2) ma

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Chet Ramey
On 5/4/21 2:31 AM, Koichi Murase wrote: I'm still thinking about whether it is possible to use buffered read in more cases of mapfile. (1) Suggestion: use buffered read for a regular file for delim != '\n'? It won't work on any system that doesn't return -1/ESPIPE when you try to lseek on a te

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Andreas Schwab
On Mai 04 2021, Chet Ramey wrote: > On 5/4/21 3:26 AM, Andreas Schwab wrote: >> On Mai 03 2021, Chet Ramey wrote: >> >>> It won't work on any system that doesn't return -1/ESPIPE when you try >>> to lseek on a terminal device. Glibc does; >> Glibc doesn't do anything, it just uses what the kernel

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Chet Ramey
On 5/4/21 3:26 AM, Andreas Schwab wrote: On Mai 03 2021, Chet Ramey wrote: It won't work on any system that doesn't return -1/ESPIPE when you try to lseek on a terminal device. Glibc does; Glibc doesn't do anything, it just uses what the kernel says. You'd think, but the manual says otherwi

Re: Why does "mapfile -d delim" (delim != '\n') use unbuffered read?

2021-05-04 Thread Andreas Schwab
On Mai 03 2021, Chet Ramey wrote: > It won't work on any system that doesn't return -1/ESPIPE when you try > to lseek on a terminal device. Glibc does; Glibc doesn't do anything, it just uses what the kernel says. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB4