[Patch] libstdc++/22131
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Jun 28 14:28:00 GMT 2005
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
More information about the Libstdc++
mailing list