Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #80933: SplFileObject::fgets() stops at NUL byte for DROP_NEW_LINE #6836

Closed
wants to merge 6 commits into from

Commits on Apr 5, 2021

  1. Fix #80933: SplFileObject::fgets() stops at NUL byte for DROP_NEW_LINE

    `buf` may contain NUL bytes, so we must not use `strcspn()` but rather
    the binary safe `php_strcspn()`.
    
    Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
    cmb69 committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    5452d65 View commit details
    Browse the repository at this point in the history
  2. Drop const qualifier

    `php_strcspn()` expects `char*`s prior to PHP 8.0.0.
    
    Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
    cmb69 committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    0fa3859 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2021

  1. Properly cater to line endings

    We must not assume that either CR or LF are valid line endings, but
    should use `php_stream_locate_eol()` in the first place.
    cmb69 committed Apr 7, 2021
    Configuration menu
    Copy the full SHA
    4621da5 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2021

  1. Configuration menu
    Copy the full SHA
    c5ee470 View commit details
    Browse the repository at this point in the history
  2. Drop unused variable

    cmb69 committed Apr 13, 2021
    Configuration menu
    Copy the full SHA
    6d7afd8 View commit details
    Browse the repository at this point in the history
  3. We only need to deal with a newline at the end

    Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
    cmb69 and nikic committed Apr 13, 2021
    Configuration menu
    Copy the full SHA
    a81f73b View commit details
    Browse the repository at this point in the history