[Gnucash-changes] check_data_type, backend configuration and gettext

Derek Atkins warlord at MIT.EDU
Mon Sep 5 10:16:19 EDT 2005


BAD NEIL!

Why are you replacing gnc_{un,}setenv() with {un,}setenv() when NOT
ALL SYSTEMS HAVE SETENV?  This extra indirection exists FOR A REASON.
Why are you blithley replacing this API with something that WONT WORK
ON ALL PLATFORMS?

Please refrain from doing this.  If you find yourself replacing
gnc-APIs like this, please send mail and ask why it exists before you
just go ahead and remove it.  You don't necessarily have the big
picture of why it exists, and removing it will BREAK WORKING CODE.

Bad Neil!  No Biscuit!

-derek

Neil Williams <codehelp at cvs.gnucash.org> writes:

> --- src/backend/file/sixtp-utils.c
> +++ src/backend/file/sixtp-utils.c
> @@ -388,34 +388,26 @@
>  gnc_timegm (struct tm *tm)
>  {
>    time_t result;
> -#ifdef GNUCASH_MAJOR_VERSION
> -  char *put_str;
> -#endif
>    char *old_tz;
>  
>    old_tz = getenv ("TZ");
> -#ifdef GNUCASH_MAJOR_VERSION
> -/** \todo Implement a separate method of configuration handling. */
>    /* FIXME: there's no way to report this error to the caller. */
> -  if(gnc_setenv("TZ", "UTC", 1) != 0)
> +  if(setenv("TZ", "UTC", 1) != 0)
>      PERR ("couldn't switch the TZ.");
> -#endif
>    result = mktime (tm);
> -#ifdef GNUCASH_MAJOR_VERSION
>    if(old_tz)
>    {
>      /* FIXME: there's no way to report this error to the caller. */
> -    if(gnc_setenv("TZ", old_tz, 1) != 0)
> +    if(setenv("TZ", old_tz, 1) != 0)
>        PERR ("couldn't switch the TZ back.");
>    }
>    else
>    {
>      /* FIXME: there's no way to report this error to the caller. */
> -    gnc_unsetenv("TZ");
> +    unsetenv("TZ");
>      if(errno != 0)
>        PERR ("couldn't restore the TZ to undefined.");
>    }
> -#endif
>    return result;
>  }
>  #endif


-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-changes mailing list