History log of /PHP-8.1/ext/spl/tests/bug62004.txt (Results 1 – 1 of 1)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
Revision tags: php-8.1.7RC1, php-8.1.4RC1, php-8.1.3, php-8.1.2RC1, php-8.1.0, php-7.3.33, php-7.3.32, php-7.3.31, php-7.3.30, php-7.3.29, php-7.3.28, php-7.3.27, php-7.3.26, php-7.3.26RC1, php-7.3.25
# f1d11c11 18-Nov-2020 Christoph M. Becker

Fix #62004: SplFileObject: fgets after seek returns wrong line

As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file poi

Fix #62004: SplFileObject: fgets after seek returns wrong line

As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file pointer to the
beginning of the following line, having line `$n` already read into the
line buffer. This is pretty inconsistent; we fix it by always seeking
to the beginning of the line.

We also add a test case for the duplicate bug #46569.

Closes GH-6434.

show more ...