Fix bug using localeconv info.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3068 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-10-23 10:16:07 +00:00
parent 8d5203ff16
commit 43e14a3d2c

View File

@ -467,18 +467,34 @@ gnc_localeconv(void)
}
gnc_commodity *
gnc_locale_default_currency(void) {
gnc_locale_default_currency(void)
{
static gnc_commodity * currency;
struct lconv * lc;
static gboolean got_it = FALSE;
if(got_it == FALSE) {
if (got_it == FALSE)
{
char *symbol;
lc = gnc_localeconv();
symbol = g_strdup (lc->int_curr_symbol);
/* The int_curr_symbol includes a space at the end! Note: you
* can't just change "USD " to "USD" in gnc_localeconv, because
* that is only used if int_curr_symbol was not defined in the
* current locale. If it was, it will have the space! */
g_strstrip (symbol);
currency = gnc_commodity_table_lookup (gnc_engine_commodities(),
GNC_COMMODITY_NS_ISO,
lc->int_curr_symbol);
symbol);
g_free (symbol);
got_it = TRUE;
}
return currency;
}