Follow-up Comment #5, bug #27983 (project findutils):
> Then you use cat, which preserves binary mode, through a pipe which also preserves binary mode. But this is a valid sequence of commands, and Cygwin should preserve the behavior of this sequence regardless of the input's low-level line endings, as long as the latter are in accord with the text mode detection rules. Pipes are the corner case and this is why I appeal to force explicit input conversion in Cygwin's xargs. The attached patch made the CRs disappear on reading the pipe. I also realized that the "t" and "b" options in the fopen() mode argument are supposed to be irrelevant in the POSIX world. Here are the outputs of the improved test script. Before the patch: $ PATH="/usr/src/findutils-4.5.5-1/build/xargs:${PATH}" ./text-mode.sh umount: /textmode: Invalid argument mount: warning - /textmode does not exist. CR found in /textmode/file1.txt. *** Unexpectedly, CR found in /textmode/file2.txt. CR found in /textmode/file3.txt. *** Unexpectedly, CR not found in /textmode/file4.txt. CR not found in /textmode/file5.txt. CR not found in /textmode/file6.txt. After the patch: $ PATH="/usr/src/findutils-4.5.5-1/build/xargs:${PATH}" ./text-mode.sh umount: /textmode: Invalid argument mount: warning - /textmode does not exist. CR found in /textmode/file1.txt. CR not found in /textmode/file2.txt. CR found in /textmode/file3.txt. CR found in /textmode/file4.txt. CR not found in /textmode/file5.txt. CR not found in /textmode/file6.txt. (file #20165, file #20166) _______________________________________________________ Additional Item Attachment: File name: xargs-4.5.5-1-explicit-text-or-binary-mode.txt Size:0 KB File name: text-mode.sh Size:5 KB _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?27983> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/