Re: [PATCH 06/11] compat/pread: check initial lseek for errors
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 5, 2026, 14:29 UTC
- Message-ID
- <11e705f9-d64f-f8c8-3967-d3289e47eb91@gmx.de>
- In-Reply-To
- <alcvjynWsHZKXD84@pks.im>
Hi Patrick,
On Wed, 15 Jul 2026, Patrick Steinhardt wrote:
Show 18 quoted lines
> On Tue, Jul 14, 2026 at 10:48:39PM +0000, Johannes Schindelin via GitGitGadget wrote: > > diff --git a/compat/pread.c b/compat/pread.c > > index 484e6d4c71..ac7d058cb8 100644 > > --- a/compat/pread.c > > +++ b/compat/pread.c > > @@ -7,6 +7,8 @@ ssize_t git_pread(int fd, void *buf, size_t count, off_t offset) > > ssize_t rc; > > > > current_offset = lseek(fd, 0, SEEK_CUR); > > + if (current_offset < 0) > > + return -1; > > > > if (lseek(fd, offset, SEEK_SET) < 0) > > return -1; > > Heh, funny. I wanted to complain about misindentation here, but your new > code is actually indented correctly. It's everything else in this file > that is indented with spaces.
Heh. I did notice something odd going on, thinking that Opus ignored my clear instructions about tab-indentation once again when I replaced the spaces by tabs...
Ciao, Johannes