Thanks, Hub. This code seems correct to me and I'm
sorry for introducing the bug in the first place. I'm
glad that the unit test now passes.
I've committed a slight variant of this patch.
Thanks,
Dom
--- Hubert Figuiere <hfiguiere@teaser.fr> wrote:
> the locale bug described by jean Brefort is still
> there. Now that we
> have fixed this issue about anonymous constructs, we
> should fix it.
> Attached is the patch so that someone else can test
> it...
>
> It should then be backported...
>
> Note that the Unit Test pass with this.
>
> Hub
> > Index: src/af/util/xp/ut_locale.cpp
>
===================================================================
> RCS file:
> /cvsroot/abi/src/af/util/xp/ut_locale.cpp,v
> retrieving revision 1.12
> diff -u -p -u -r1.12 ut_locale.cpp
> --- src/af/util/xp/ut_locale.cpp 18 Apr 2005
> 15:40:08 -0000 1.12
> +++ src/af/util/xp/ut_locale.cpp 19 Apr 2005
> 20:10:39 -0000
> @@ -20,8 +20,9 @@
> #include <stdlib.h>
> #include <stdio.h>
>
> -#include "ut_string.h";
> +#include "ut_string.h"
> #include "ut_locale.h"
> +#include "ut_debugmsg.h"
>
> // don't like XAP in UT, but oh well...
> #include "xap_EncodingManager.h"
> @@ -50,15 +51,15 @@ explicit_setlocale (int
> category, const
> UT_LocaleTransactor::UT_LocaleTransactor (int
> category, const char * locale)
> : mCategory (category), mOldLocale (0)
> {
> - char * old_locale = explicit_setlocale (category,
> locale);
> - mOldLocale = UT_strdup(old_locale);
> + mOldLocale = UT_strdup(setlocale(category, NULL));
> + char *old_locale = explicit_setlocale (category,
> locale);
>
> // TODO: win32 may need to free old_locale
> }
>
> UT_LocaleTransactor::~UT_LocaleTransactor ()
> {
> - static_cast<void>(explicit_setlocale (mCategory,
> mOldLocale));
> + explicit_setlocale (mCategory, mOldLocale);
> FREEP(mOldLocale);
> }
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on Wed Apr 20 15:07:06 2005
This archive was generated by hypermail 2.1.8 : Wed Apr 20 2005 - 15:07:08 CEST