delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/20/07:59:07

X-Recipient: archive-cygwin AT delorie DOT 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 AT byu DOT 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 AT cygwin DOT com, cygwin AT cygwin DOT com
Subject: Re: mbrtowc bug
References: <4A6451C0 DOT 9050504 AT byu DOT net> <20090720114240 DOT GB30066 AT calimero DOT vinschen DOT de> <20090720115529 DOT GC30066 AT calimero DOT vinschen DOT de>
In-Reply-To: <20090720115529.GC30066@calimero.vinschen.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 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 AT byu DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019