From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12171 invoked by alias); 25 Apr 2016 17:23:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38337 Received: (qmail 14683 invoked from network); 25 Apr 2016 17:23:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.1 Date: Mon, 25 Apr 2016 10:16:58 -0700 (PDT) From: "Peter A. Castro" To: Peter Stephenson cc: zsh-workers@zsh.org Subject: Re: Possible ZSH bug with IO direction In-Reply-To: <20160424200132.7d0d00bc@ntlworld.com> Message-ID: References: <571BBF3C.50402@matrix.ai> <160423151436.ZM6912@torch.brasslantern.com> <20160424131748.441d605f@pwslap01u.europe.root.pri> <160424113644.ZM3576@torch.brasslantern.com> <20160424200132.7d0d00bc@ntlworld.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Sun, 24 Apr 2016, Peter Stephenson wrote: > Date: Sun, 24 Apr 2016 20:01:32 +0100 > From: Peter Stephenson > To: zsh-workers@zsh.org > Subject: Re: Possible ZSH bug with IO direction Greetings, Peter S. I'm the author of the offending Cygwin pre-main hook, so you can squarely level any complains about it at me. I'm also the maintainer of the Cygwin port, for whatever that's worth. :) > On Sun, 24 Apr 2016 11:36:44 -0700 > Bart Schaefer wrote: >> On Apr 24, 1:17pm, Peter Stephenson wrote: >> } >> } Mounting the filesystem within Cygwin as binary works here. >> >> Really? That contradicts what the main.c comment asserts. > > So it seems like "binary" isn't quite what it's cracked up to be. No, it's not. Neither is "text" mode. :) > The alternative might be to do something similar in the lower levels of > zsh, i.e. map \r\n to \n when reading shell input. If done in input.c > it's no worse than doing it in the OS abstraction, and doesn't affect > fd's used by othe programmes. I tried to put this kind of specific control (O_TEXT) only in input.c (and a few other places), but there are too many places in the code that just "know" line-termination is 1 character and either loop trying to read more input or simply choke on the difference in size read vs. size expected. It quickly became dozens of source modules affected and still I wasn't catching them all. I never really got it to work fully and just gave up, putting in the pre-main hook as a band-aid until some better solution presented itself. Really, the code needs to understand CR+LF. I lacked the time to fully understand all of the Zsh code so never went back to try and create a proper fix. Some guidance on this would be welcome. > pws -- --=> Peter A. Castro Email: doctor at fruitbat dot org / Peter dot Castro at oracle dot com "Cats are just autistic Dogs" -- Dr. Tony Attwood