X-Spam-Check-By: sourceware.org Message-ID: <454505C8.3010700@byu.net> Date: Sun, 29 Oct 2006 12:49:28 -0700 From: Eric Blake User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: gunzip 1.3.5 error reading from stdin on Cygwin [attn zsh maintainer] References: <20a807210610290514k7f17abdfja21c611b45ff468b AT mail DOT gmail DOT com> <061029095227 DOT ZM8389 AT torch DOT brasslantern DOT com> In-Reply-To: <061029095227.ZM8389@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bart Schaefer on 10/29/2006 10:52 AM: > On Oct 29, 5:14am, Vin Shelton wrote: > } Subject: Re: gunzip 1.3.5 error reading from stdin on Cygwin > } > } I've narrowed this down a little bit. It only happens under zsh; > } under bash, the recipe works without error. > > In zsh's main.c is this comment: > > * Cygwin supports the notion of binary or text mode access to files > * based on the mount attributes of the filesystem. If a file is on > * a binary mounted filesystem, you get exactly what's in the file, CRLF's > * and all. If it's on a text mounted filesystem, Cygwin will strip out > * the CRs. This presents a problem because zsh code doesn't allow for > * CRLF's as line terminators. So, we must force all open files to be > * in text mode reguardless of the underlying filesystem attributes. Oh no, here we go again. This is the exact same bug that bash-3.1-6 had - by opening ALL files in text mode from a shell, you are forced to read those files one byte at a time to honor POSIX semantics that on a seekable file, child processes see the same file offset as where the shell stopped reading, but you can't reliably lseek backwards on a text mode file. My recommendation would be for zsh to take its turn to fix the bug and honor binary mounts with binary semantics, even if it means that interpreting literal \r causes strange syntax errors. - -- Life is short - so eat dessert first! Eric Blake ebb9 AT byu DOT net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFRQXI84KuGfSFAYARAvPKAKCvcjUT40tpm7Ai3SGhZsof/cF0kwCdHeW2 Jh89vr095QMo7+qmneEsYrk= =52Hb -----END PGP SIGNATURE----- -- 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/