This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] libstdc++/22131
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: 28 Jun 2005 16:27:31 +0200
- Subject: Re: [Patch] libstdc++/22131
- References: <42C15BBC.9090701@suse.de>
Paolo Carlini <pcarlini@suse.de> writes:
| *** 1,6 ****
| // Wrapper for underlying C-language localization -*- C++ -*-
|
| ! // Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
| //
| // This file is part of the GNU ISO C++ Library. This library is free
| // software; you can redistribute it and/or modify it under the
| --- 1,6 ----
| // Wrapper for underlying C-language localization -*- C++ -*-
|
| ! // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
^
I was under the impression that all years must be listed, as the
question of whether the files ceased to be copyrighted FSF in 2004 may
be raised (pleaee, I'm not a lawyer so don't ask me why anybody would
do that :-))
[...]
| template<>
| *************** namespace std
| *** 90,110 ****
| __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
| const __c_locale&)
| {
| ! if (!(__err & ios_base::failbit))
| ! {
| ! // Assumes __s formatted for "C" locale.
| ! char* __old = strdup(setlocale(LC_ALL, NULL));
| ! setlocale(LC_ALL, "C");
| ! char* __sanity;
| ! errno = 0;
| ! double __d = strtod(__s, &__sanity);
| ! if (__sanity != __s && errno != ERANGE)
| ! __v = __d;
| ! else
| ! __err |= ios_base::failbit;
| ! setlocale(LC_ALL, __old);
| ! free(__old);
| ! }
| }
|
| template<>
| --- 87,104 ----
| __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
| const __c_locale&)
| {
| ! // Assumes __s formatted for "C" locale.
| ! char* __old = strdup(setlocale(LC_ALL, NULL));
| ! setlocale(LC_ALL, "C");
| ! char* __sanity;
| ! errno = 0;
I know this is not introduced by your patch, but I'm wondering whether
there is a reason why we would not want to preserve the value errno
had before making the internal call to strdup.
-- Gaby