X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Wed, 22 Apr 2009 10:31:45 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: [1.7] Updated: cygwin-1.7.0-45
Message-ID: <20090422083145.GQ8722@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20090331111757.GA22043@calimero.vinschen.de> <200904031037.n33Ab4Ma001073@mail.bln1.bf.nsn-intra.net> <20090403145139.GJ12738@calimero.vinschen.de> <200904211025.n3LAPf7a022955@mail.bln1.bf.nsn-intra.net> <20090421152334.GH8722@calimero.vinschen.de> <20090421161337.GG18867@trikaliotis.net> <20090421165642.GK8722@calimero.vinschen.de> <20090421175436.GA18266@calimero.vinschen.de> <49EE5D4D.8030906@gmail.com> <49EE9A96.6040900@byu.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <49EE9A96.6040900@byu.net>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Apr 21 22:18, Eric Blake wrote:
> The bug was that isblank(-1) was blindly treated as if were equivalent
> with isblank(0xff), which, in some locales, is flat out wrong
> (isblank(EOF) should always be 0, even when isblank(0xff) is well-defined
> as 1).  Broken apps can't tell the difference between isblank((char)0xff)
> and isblank(EOF), but correct apps, like sed, CAN tell the difference
> between 0xff and EOF in "int ch = getchar(); isblank(ch)" since getchar()
> returns an int containing an unsigned char value (and not a char).
> 
> Sed's infinite loop, then, was because of newlib/cygwin's bug - sed
> reached the end of the file while trying to skip blanks, but because
> isblank() was returning the wrong value for -1, sed thought that EOF was a
> blank and kept trying to read the file instead of breaking out of the loop.

Thanks for the explanation.  Apparently I'm unable to explain this
clearly enough.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

