This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compile-time detection of EOL translation mode (CLISP)

Reini Urban wrote:

Bug patched at

It's been moved to <> with the following comment from Sam Steingold:

This patch does not seem right.
on linux O_BINARY==0 and I see no reason to default line
termination to :DOS there.
I am rejecting it pending your convincing me that I am
wrong here.

To be honest, it didn't seem quite right to me either, but I figured that was down to me not knowing the ins and outs of how Cygwin handles text modes.

The original logic was:

#if defined(WIN32) || (defined(UNIX) && (O_BINARY != 0))
 pushSTACK(S(Kdos));           /* :line-terminator */
 pushSTACK(S(Kunix));          /* :line-terminator */

which translates to "if O_BINARY is something other than 0, then this unix must differentiate between text and binary streams, so assume that text streams use dos EOLs". That makes sense, except that O_BINARY is nonzero even on (for instance) my Cygwin installation, where I selected unix EOLs as the default with setup.exe.

The patch changes the condition to:

#if defined(WIN32) || (defined(UNIX) && (O_BINARY == 0))

which, as Sam pointed out, would make most unixes (on which O_BINARY is 0) use dos EOLs.


Beginning Lua Programming:

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]