On 2:14:45 pm 2005-07-03 Lennart Borgman <lennart.borgman.073@...> wrote:
> Lennart Borgman wrote:
> > Thank you for the answer and sorry for the confusion. I am not
> > building MSYS, I just ran into a problem with jka-compr in Emacs.
> > It does automatic compression/uncompression. For doing this it
> > calls "gzip". For some reason it does not work if MSYS gzip is
> > used so I wanted to track that.
> > I believe it is run by CreateProcess. Perhaps this can be resolved
> > in another way? This works when using GnuWin32 gzip. However if
> > you use MSYS you do not want the GnuWin32 tools in the path at the
> > same time. Why does not MSYS gzip work in this situation? Could it
> be fixed?
> I looked a bit closer at this. I ran "gzip -c -q -d myfile.tar.gz >
> out.tmp". This is the result:
> 2005-07-03 03:59p 5,642,240 gnuwin32.tmp -- using GnuWin32
> gzip.exe and cmd.exe
> 2005-07-03 03:59p 5,642,240 msys.tmp -- using MSYS sh and
> 2005-07-03 04:00p 5,798,922 msyscmd.tmp -- using MSYS
> gzip.exe from cmd.exe
> D:\SomeDir>fc gnuwin32.tmp msys.tmp
> Comparing files gnuwin32.tmp and MSYS.TMP
> FC: no differences encountered
> A count of words gives:
> D:\SomeDir>wc *.tmp
> 156684 631360 5642240 gnuwin32.tmp
> 156684 631360 5642240 msys.tmp
> 156684 631360 5798922 msyscmd.tmp
> It looks like line ends have been added in the case when MSYS
> gzip.exe and cmd.exe where used:
> D:SomeDir>perl -e "print 5642240+156684
> Unfortunately this makes it hard to use MSYS in this case. Can the
> adding of new line endings be turned off?
MSYS doesn't add to the line endings, your experience is that it doesn't
remove the \r from the line endings on read. Therefore you are
experiencing windows cmd.exe adding more \r when you redirect the output to
a file. I'm guessing that if you look at msyscmd.tmp in binary input mode
you will see line endings appearing as \r\r\n.
To fix this would require work with gzip to ensure that the redirected
stdout is open in binary mode. Should be easy enough to do in the gzip
source base. Open a bug report for MSYS and please include the reference
to this email thread.