Rationale for line-ending recommendation?

Spiro Trikaliotis an-cygwin@spiro.trikaliotis.net
Fri Dec 19 09:07:00 GMT 2008

Hello David,

* On Thu, Dec 18, 2008 at 05:42:20PM -0900 David Abrahams wrote:
> Can anyone explain why the installer began recommending using *nix line
> ending conventions?  DOS-compatible endings have always "just worked"
> for me and I've heard of lots of problems doing it the now-recommended
> way.

Personally, I also install it with CR/LF line endings.

However, I noticed one problem this way: xfonts. If you install xfonts
on cygwin with CR/LF line endings, the fonts end up corrupt, and you
cannot start X. I was bitten by this problems many times, whenever I
installed a fresh Cygwin.

To fix this, I use the following way: I mount /var/cache (which also has
/var/cache/fonts/) in binmode, and reinstall xfonts.

This is a long-running problem.

Another problem I once had, but which might have been fixed in the
meantime, was the gcc compiler for the Lego mindstorms: It did not
accept sources files with DOS line endings. Note, however, that this was
2000 or 2001, so it might have changed in the meantime.

Oh, and Subversion is problematic, too. Because the SVN developers
decided to handle line endings on their own using libapr, opening files
in binary mode and reading and writing CR, LF or CR/LF on their own, on
Cygwin, SVN is hard-coded to *nix line endings. This is not nice. Note
that this approach will also fail badly if you mount parts of your
system in textmode, and parts in binmode.

Because of this, I am using an SVN version which I compiled myself with
a patched libapr.

Other than that, I never had any problems with the CR/LF line endings.
However, the rationale might be that most problems are testing better
with LF line endings, as they come from the *nix world. Remember, on
*nix systems, the difference between opening a file in text- or in
binmode is practically non-existant. Thus, many programmers do not care
about the "right" mode.

Best regards,

Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/

Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

More information about the Cygwin mailing list