Skip to content

Conversation

@harenbrs
Copy link
Owner

@harenbrs harenbrs commented Apr 9, 2020

split("\n") includes a final empty element "" if the final line
ends with \n (as it should for POSIX-compliant text files), which
then became an extra "\n".

splitlines() solves that, but there's a caveat, as it will split
on other types of line breaks too (like \r), which may not be
desired.

Fixes #526.

`split("\n")` includes a final empty element `""` if the final line
ends with `\n` (as it should for POSIX-compliant text files), which
then became an extra `"\n"`.

`splitlines()` solves that, but there's a caveat, as it will split
on other types of line breaks too (like `\r`), which may not be
desired.

Fixes #526.
@harenbrs harenbrs merged commit 86f56d1 into harenbrs:master Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--diff output does not git apply cleanly when the diff context includes EOF

2 participants