X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 	tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4A645C07.4090501@byu.net>
Date: Mon, 20 Jul 2009 05:59:03 -0600
From: Eric Blake <ebb9@byu.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin@cygwin.com, cygwin@cygwin.com
Subject: Re: mbrtowc bug
References: <4A6451C0.9050504@byu.net> <20090720114240.GB30066@calimero.vinschen.de> <20090720115529.GC30066@calimero.vinschen.de>
In-Reply-To: <20090720115529.GC30066@calimero.vinschen.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 7/20/2009 5:55 AM:
> 
> What bug?!?  When I run this testcase on Cygwin 1.7, it returns 0.  What
> is the supposed error and what is expected if it's behaving correctly?

Hmm.  Here's what it did for me on Windows XP (maybe the bug is in the
underlying Windows functions, which has since been fixed in your Windows
version?)

Breakpoint 1, main () at foo.c:5
5       {
(gdb) n
6         if (setlocale (LC_ALL, "ja_JP.eucJP") != NULL)
(gdb)
8             char input[] = "B\217\253\344\217\251\316er";
(gdb)
13            memset (&state, '\0', sizeof (mbstate_t));
(gdb)
14            if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
(gdb)
16                input[1] = '\0';
(gdb)
17                if (mbrtowc (&wc, input + 2, 5, &state) != 2)
(gdb)
18                  return 1;
(gdb)

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpkXAcACgkQ84KuGfSFAYCUGgCggywgNKTpC3eAkRZ/eXpIyz1J
uxQAnjdfODyhH2tr17obi/BaNu6kdk1E
=0l5s
-----END PGP SIGNATURE-----

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

