From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4454 invoked from network); 3 Apr 2004 01:26:03 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Apr 2004 01:26:03 -0000 Received: (qmail 12647 invoked by alias); 3 Apr 2004 01:25:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19724 Received: (qmail 12621 invoked from network); 3 Apr 2004 01:25:51 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Apr 2004 01:25:51 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Apr 2004 1:25:51 -0000 Received: (qmail 5114 invoked from network); 3 Apr 2004 01:25:51 -0000 Received: from ip-66-80-62-153.dsl.sca.megapath.net (HELO ripple.fruitbat.org) (66.80.62.153) by a.mx.sunsite.dk with SMTP; 3 Apr 2004 01:25:49 -0000 Received: (from daemon@localhost) by ripple.fruitbat.org (8.10.2/8.8.8/PAC-1.3) id i331O2a07949; Fri, 2 Apr 2004 17:24:02 -0800 Received: from ming.fruitbat.org(192.168.1.2) by ripple.fruitbat.org via smap (V2.1/2.1+anti-relay+anti-spam) id xma007945; Fri, 2 Apr 04 17:23:53 -0800 Received: from gremlin.fruitbat.org (IDENT:202@gremlin.fruitbat.org [192.168.1.4]) by ming.fruitbat.org (8.10.2/8.10.2/PAC-1.6) with ESMTP id i332Nri31338; Fri, 2 Apr 2004 18:23:53 -0800 Date: Fri, 2 Apr 2004 17:23:57 -0800 (PST) From: "Peter A. Castro" To: Oliver Kiddle cc: zsh-workers@sunsite.dk, cygwin@cygwin.com Subject: Re: zsh and line breaks In-Reply-To: Message-ID: References: <1vvf60l9i7n4nlobcroik2le5ofe6v2rn4@4ax.com> <3372.1080639122@trentino.logica.co.uk> <2603.1080737128@trentino.logica.co.uk> <25057.1080810596@trentino.logica.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 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 or "Cats are just autistic Dogs" -- Dr. Tony Attwood