Normalize line endings when patching files

Review Request #107 — Created July 2, 2007 and submitted — Latest diff uploaded

Information

Review Board SVN (deprecated)
trunk
78, 143

Reviewers

This is a simpler fix than the CRLF patches sitting around. Instead of fixing line endings when we parse the files (and trying hard to preserve line endings), just normalize at patch time to \n. Since we're not actually doing anything with the resulting file aside from displaying it, this is a good enough fix and is safe.

We don't want to normalize when parsing the diff because that would modify the raw diff file. We should be leaving that alone.
Added test cases for each combination of source file and diff line endings that we need to test. Before this change, the unit tests were failing when trying to patch a non-CRLF file with a CRLF diff or vice-versa. Now all unit tests pass.
    Loading...