Closed michellemcdaniel closed 9 years ago
@swaroop-sridhar PTAL
Would read().split("\n") be sufficient? Green. Please submit the patch to clang as well. Thanks.
No, it would not. Splitting on \n doesn't catch the \r, which is the comparison that is causing problems. splitlines() catches \n and \r
By using readlines() when splitting the lines of code for formatted and unformatted files, clang-format-diff.py reports lines that do not have diffs as having diffs because the line endings in the original code differs from the line endings generated by clang-format on Windows. This fix changes clang-format-diff.py to use read().split() which discards line endings, fixing this problem.