delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/09/12:34:38

X-Spam-Check-By: sourceware.org
Message-ID: <6910a60701090934iff9bd94h3157e3b7d09bb31b@mail.gmail.com>
Date: Tue, 9 Jan 2007 18:34:07 +0100
From: "Reini Urban" <rurban AT x-ray DOT at>
To: cygwin AT cygwin DOT com
Subject: Re: Compile-time detection of EOL translation mode (CLISP)
In-Reply-To: <001b01c73033$ee617c20$0708090a@CAM.ARTIMI.COM>
MIME-Version: 1.0
References: <BAY112-DAV120EB321505D27E8138E91C5B80 AT phx DOT gbl> <001b01c73033$ee617c20$0708090a AT CAM DOT ARTIMI DOT COM>
X-Google-Sender-Auth: e8f95e57193eaa49
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

2007/1/4, Dave Korn <dave DOT korn AT artimi DOT com>:
> On 04 January 2007 18:58, Aaron Brown wrote:
>
> > Dave Korn wrote:
>
> >>  What is the /end/ result you're trying to achieve here?
> >
> > When CLISP does text output, it opens the file in binary
> > mode and does EOL translation itself, according to the
> > requested line terminator mode.  For instance, the following
> > function writes a file with LF, CRLF, or CR EOLs depending
> > on whether its argument is :unix, :dos, or :mac.
>
> > That works exactly as intended.
>
>   Good, and indeed, CLISP should probably not care either way about the mount
> mode on which it writes these files, because that's the whole point of
> textmounts: to provide a way for the user to instruct cygwin (the kernel,
> effectively) to override the application's choice at a lower level when
> needed.
>
> > My problem is that if I
> > don't specify a :line-terminator, :dos is used instead of
> >> unix.  (This is controlled by *default-file-encoding*,
> > which itself is set by line 2571 of encoding.d when CLISP is
> > compiled.)
>
>   Ok, that is simply the wrong default, and I think it is /that/ which needs
> to be fixed.
>
> > The reason I expect :unix to be the default
> > rather than :dos is that when I ran the Cygwin setup.exe, I
> > selected the "Unix / binary (RECOMMENDED)" radio button
> > under "Default Text File Type".  Is this expectation
> > unwarranted?
>
>   Yes, it is really; unless CLISP used some compile-time autoconf test to
> figure this out and adjust that default you mentioned, how else could it make
> a difference?
>
> > The one-sentence version of the problem: CLISP writes
> > newlines as "\r\n" by default, when I want the default to be
> > "\n".
> >
> > I could just specify :unix every time, but that's a hassle
> > and is (as far as I can tell) impossible with standard
> > output.
>
>   This smacks of a build/packaging error to me, but perhaps it was a
> deliberate decision; we need to hear from the CLISP maintainer.  Without
> having looked into building CLISP, I don't know whether it would just need an
> option when configuring or a #define patched into the source somewhere.

The maintainer is now back from holidays.
We really have to ask upstream Sam why he wanted to use global
DOS EOL for cygwin. Probably to support default textmounts.

But then
defined(UNIX) && (O_BINARY != 0) seems to only target cygwin and looks
like an upstream bug to me. If binary then do binary and not DOS.

Thanks for the report!
I'll check and update it then.
-- 
Reini Urban
http://phpwiki.org/              http://murbreak.at/
http://spacemovie.mur.at/   http://helsinki.at/

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019