make-w32
[Top][All Lists]
Advanced

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

Re: Schedule for GNU make 3.81


From: Kees Zeelenberg
Subject: Re: Schedule for GNU make 3.81
Date: Wed, 23 Feb 2005 20:59:17 +0100

The GnuWin32 (http://gnuwin32.sourceforge.net/) port of DiffUtils reads input files in text mode, and so CR-LF is internally (in the file buffer supplied by fopen in msvcrt.dll) converted to LF. In this way it can even compare correctly two files one of which has CR-LF line endings and the other LF line endings, but which otherwise are identical.

Kees Zeelenberg

----- Original Message ----- From: "Eli Zaretskii" <address@hidden>
To: "Earnie Boyd" <address@hidden>
Cc: <address@hidden>; <address@hidden>; <address@hidden>
Sent: Wednesday, February 23, 2005 7:08 PM
Subject: Re: Schedule for GNU make 3.81


Date: Wed, 23 Feb 2005 08:08:55 -0500 (EST)
From: "Earnie Boyd" <address@hidden>
Cc: address@hidden, address@hidden, address@hidden

> That's better than nothing, but I think Diff should ignore CR
> characters _by_default_, without any extra switches.  That way, you
> won't need to hack scripts that test files produced on Windows against
> expected results that come from Unix.
>

Unfortunately that isn't always correct. MSYS operates in ``binary mode''
and not ``text mode'' so that files that end in \n remain that way.

You mean _all_ MSYS ports _always_ use binary mode?  If so, I find
such a sweeping decision to be unwise at the very least.  In my
experience, the decision which I/O mode to use is best left to each
individual ported program, since one needs an intimate knowledge of
the application in order to choose the best mode.

In the case of Diff, there's already code in the official sources to
use the text mode by default, and only switch to binary mode for
specific command-line options.  That code is working well for the
DJGPP port of Diff, so why cannot MSYS use the same code?

I provided the treat \r as white space to deal with file a has \r\n
and file b has \n line endings.  The two files are different and one
could make the case that they wanted the diff file to show that
difference.

If they want such files to compare different, they can use --binary.
In my experience, the occasions when it is desirable to see such
differences are by far less frequent than the opposite situations, and
usually happen in interactive usage, where --binary is a good
solution.


_______________________________________________
Make-w32 mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/make-w32








reply via email to

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