www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/02/20:26:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Fri, 2 Apr 2004 17:23:57 -0800 (PST)
From: "Peter A. Castro" <doctor AT fruitbat DOT org>
To: Oliver Kiddle <okiddle AT yahoo DOT co DOT uk>
cc: zsh-workers AT sunsite DOT dk, cygwin AT cygwin DOT com
Subject: Re: zsh and line breaks
In-Reply-To: <Pine.LNX.4.53.0404011224320.9892@gremlin.fruitbat.org>
Message-ID: <Pine.LNX.4.53.0404021705390.11532@gremlin.fruitbat.org>
References: <s38u10erwrz DOT fsf AT ackusativ DOT ling DOT uu DOT se> <1vvf60l9i7n4nlobcroik2le5ofe6v2rn4 AT 4ax DOT com> <Pine DOT LNX DOT 4 DOT 53 DOT 0403291441160 DOT 5939 AT gremlin DOT fruitbat DOT org> <3372 DOT 1080639122 AT trentino DOT logica DOT co DOT uk> <Pine DOT LNX DOT 4 DOT 53 DOT 0403301047250 DOT 5939 AT gremlin DOT fruitbat DOT org> <2603 DOT 1080737128 AT trentino DOT logica DOT co DOT uk> <Pine DOT LNX DOT 4 DOT 53 DOT 0403310935450 DOT 9892 AT gremlin DOT fruitbat DOT org> <25057 DOT 1080810596 AT trentino DOT logica DOT co DOT uk> <Pine DOT LNX DOT 4 DOT 53 DOT 0404011224320 DOT 9892 AT gremlin DOT fruitbat DOT org>
MIME-Version: 1.0
X-IsSubscribed: yes

On Thu, 1 Apr 2004, Peter A. Castro wrote:

> On Thu, 1 Apr 2004, Oliver Kiddle wrote:
>
> Warning: this is long!!

Well, this time it's short!! :)

> > "Peter A. Castro" wrote:
> > > > It is easy for us to add `#ifdef __CYGWIN__' around changes or #define
> > > > O_TEXT to zero on other systems so if you do correct the problem,
> > > > please send the changes back to us.
> > >
> > > There are about 43 open() calls which I've updated with the O_TEXT
> > > option.  Having all those ifdef's seemed rather ugly (makes the code hard
> > > to look at, expectially when they are within a few lines of each other)
> > > so I took a more "elegent" approach, though you may want to revise it if
> > > it doesn't meet your style requirements :)
> >
> > I can believe that adding ifdef's to all is ugly. That's what I meant
> > by "#define O_TEXT to zero on other systems" - just one thought on a
> > possible more "elegant" approach.

Ok, forget about adding O_TEXT to the open() calls.  It's not necessary.
Thanks to Corinna from the Cygwin list, I have a better solution.  It's
very Cygwin specific, but very inobtrusive to the mainline code which is
something I really like about this fix.  I've tested it using both
binmode and textmode mounted filesystems and it passes the Test suite
with flying colors!

So, now I need a ruling on just where to put this fix.  Due to how the
fix works, it can't be placed in DLL code.  It must be linked into the
main exe.  Now, I know that main.c is basically just a platform wrapper
for calling zsh_main().  My question is, to the zsh developers, would it
be acceptable to put code into main.c or should I persue adding a
seperate source file which will have to be part of MAIN_OBJS.  I know
I'll have to hack zsh.mdd to add it as a dependency and get the various
prototype files created correctly, but I'm willing to do that.  But, do I
really need to make it a separate source file or can I add it to main?
The fix consists of a special Cygwin function which is coded and linked
into the main.  The function, itself, is very small and basically is a
hook in Cygwin to allow various internal variables to be set before the
program main gets control.  My version sets textmode related things for
file I/O.  So, again, this is a style/placement question.  Put it in
main.c or make it a separate source file (which will only be used by the
Cygwin port or possible can be a place for other ports to put such code)?

> Thanks for listening.  Any suggestions are welcome.
> > Oliver

-- 
Peter A. Castro <doctor AT fruitbat DOT org> or <Peter DOT Castro AT oracle DOT com>
	"Cats are just autistic Dogs" -- Dr. Tony Attwood

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