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

Fixes #282 #283

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danowar2k
Copy link

  • Probably an universal solution for the line ending problem: Read the file, ignore how it converted line endings and just convert it to universal newline, then work on it also using just universal newlines. Comparison of old and new content then works. Finally, just write the file using universal newlines on all systems except Windows, where we convert to CRLF

danowar2k added 2 commits May 8, 2021 21:38
- Probably an universal solution for the line ending problem: Read the file, ignore how it converted line endings and just convert it to universal newline, then work on it also using just universal newlines. Comparison of old and new content then works. Finally, just write the file using universal newlines on all systems except Windows, where we convert to CRLF
… exists, so we store the comparison result earlier and not at the end

- Second, if the file isn't changed we don't need to reencode the file contents nor do we need to save the temp hosts file. So just leave the original hosts file alone in that case.
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.

1 participant