[Top][All Lists]

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

bug#25459: sed bug: native sed-4.3 appends excessive carriage-returns wh

From: Michael Builov
Subject: bug#25459: sed bug: native sed-4.3 appends excessive carriage-returns when run in binary mode on windows
Date: Mon, 16 Jan 2017 13:03:01 +0300

Steps to reproduce.

First it's needed to build native sed.exe on windows.

It's hard, but possible, I've done this:

(Note: don't apply sed-4.3-src.patch in these instructions - it fixes
reported bug and build problems with Visual Studio 2008)

Now, if we have working native sed.exe, from cmd.exe

1) create a file containing a line terminated with '\n':

echo.1> test

check "test" contents, dump it:

c:\cygwin64\bin\xxd test
00000000: 310d 0a                                  1..

2) process file "test" with sed in binary mode:

sed\sed.exe -b "" test > test1

dump resulting file "test1":

c:\cygwin64\bin\xxd test1
00000000: 310d 0d0a                                1...

As we can see, there is excessive '0d' in result.

To fix this bug, stdout should be set to binary mode, for example by
applying attached patch.

Best Regards,
Michael M. Builov

Attachment: sed-4.3-src-stdout.patch
Description: Binary data

reply via email to

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