eBay / tsv-utils

eBay's TSV Utilities: Command line tools for large, tabular data files. Filtering, statistics, sampling, joins and more.
https://ebay.github.io/tsv-utils/
Boost Software License 1.0
1.43k stars 80 forks source link

Change Windows newline detection to occur on all platforms #320

Closed jondegenhardt closed 4 years ago

jondegenhardt commented 4 years ago

Most of the tsv-utils tools require Unix newlines. These tools check for Windows newlines on Posix platforms using throwIfWindowsNewlineOnUnix. However, these tools generally have trouble with Windows newlines on Windows platforms as well. And, there is no warning to users. This adds detection and user messaging on Windows.

The PR changes Windows newline detection to occur on all platforms. The throwIfWindowsNewlineOnUnix was renamed to throwIfWindowsNewline and the code changed to throw on all all platforms. Callers were changed to call the new function.

This is a step towards getting a Window build that has a fully functioning test suite. See issue #317. Support for Windows newlines can be evaluated after having a fully functioning test suite on Windows.