bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #27983] Windows text mode mis-interpreted


From: Ilguiz Latypov
Subject: [bug #27983] Windows text mode mis-interpreted
Date: Fri, 09 Apr 2010 02:32:04 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10pre) Gecko/20100408 Shiretoko/3.5.10pre

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]