Skip to content

Commit

Permalink
Fix double definition of DEBUG_MEMORY
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22186 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
jralls committed May 21, 2012
1 parent aeef9d3 commit 5b602c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion configure.ac
Expand Up @@ -584,7 +584,8 @@ AC_ARG_ENABLE( debug,
CFLAGS="${CFLAGS} -g ${USER_OPTIMIZATION}"
LDFLAGS="${LDFLAGS} -g"
AC_DEFINE(DEBUG_MEMORY,1,[Enable debug memory])
AC_DEFINE(DEBUG_MEMORY,0,[Enable debug memory])
],
[ AC_DEFINE(DEBUG_MEMORY,0,[Enable debug memory])
])

AC_ARG_ENABLE( profile,
Expand Down
22 changes: 16 additions & 6 deletions src/backend/dbi/gnc-backend-dbi.c
Expand Up @@ -2008,16 +2008,26 @@ row_get_value_at_col_name( GncSqlRow* row, const gchar* col_name )
{
return NULL;
}
else
{
time = dbi_result_get_datetime( dbi_row->result, col_name );
time = dbi_result_get_datetime( dbi_row->result, col_name );
/* Protect gmtime from time values < 0 to work around a mingw
bug that fills struct_tm with garbage values which in turn
creates a string that GDate can't parse. */
if (time >= 0)
{
(void)gmtime_r( &time, &tm_struct );
(void)g_value_init( value, G_TYPE_STRING );
g_value_take_string( value,
g_strdup_printf( "%d%02d%02d%02d%02d%02d",
1900 + tm_struct.tm_year, tm_struct.tm_mon + 1, tm_struct.tm_mday,
tm_struct.tm_hour, tm_struct.tm_min, tm_struct.tm_sec ) );
}
1900 + tm_struct.tm_year,
tm_struct.tm_mon + 1,
tm_struct.tm_mday,
tm_struct.tm_hour,
tm_struct.tm_min,
tm_struct.tm_sec ) );
}
else
g_value_take_string (value, "19691231235959");

break;
default:
PERR( "Field %s: unknown DBI_TYPE: %d\n", col_name, type );
Expand Down

0 comments on commit 5b602c3

Please sign in to comment.