[BZ #9677]
authorUlrich Drepper <drepper@redhat.com>
Fri, 26 Dec 2008 19:02:29 +0000 (19:02 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 26 Dec 2008 19:02:29 +0000 (19:02 +0000)
2008-12-21  Bruno Haible  <bruno@clisp.org>
[BZ #9677]
* wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Create temporary state object
if no output is written.

ChangeLog
localedata/ChangeLog
wcsmbs/mbsnrtowcs.c

index 9ea040c96fca3867250d3170bc437eb0f1e1005a..ef81776cc2691fc545885955c8929dfc7839132e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-21  Bruno Haible  <bruno@clisp.org>
+
+       [BZ #9677]
+       * wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Create temporary state object
+       if no output is written.
+
 2008-12-13  Klaus Dittrich  <kladit@arcor.de>
 
        * login/utmp_file.c (pututline_file): Replace call to dup2 with
index 2f3e26c5844cb6e3b073585ec4a632e676a5b2f5..6a7735b5142f8ec1bca818553adaa3aab6a4169f 100644 (file)
@@ -1,6 +1,6 @@
 2008-12-26  Ulrich Drepper  <drepper@redhat.com>
 
-       * tests-mbwc/tst_types.h (TIN)MBRLEN_REC): Use correct array
+       * tests-mbwc/tst_types.h (TIN_MBRLEN_REC): Use correct array
        length constant.
 
 2008-12-05  Ulrich Drepper  <drepper@redhat.com>
index 8d0b9d36094913ded5791f1af4281485b3edbba4..a5329a2331f0ce7f3449bd82101c833c7432615b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000, 2002, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2002, 2005, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
@@ -79,9 +79,13 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
     {
+      mbstate_t temp_state;
       wchar_t buf[64];         /* Just an arbitrary size.  */
       const unsigned char *inbuf = (const unsigned char *) *src;
 
+      temp_state = *data.__statep;
+      data.__statep = &temp_state;
+
       result = 0;
       data.__outbufend = (unsigned char *) buf + sizeof (buf);
       do