[grisbi-cvs] grisbi/src gsb_real.c,1.70,1.71
Pierre Biava
pbiava at users.sourceforge.net
Mon Mar 8 23:31:55 CET 2010
- Previous message: [grisbi-cvs] grisbi/po cs.po, 1.99, 1.100 da.po, 1.105, 1.106 de.po, 1.179, 1.180 el.po, 1.69, 1.70 eo.po, 1.62, 1.63 es.po, 1.175, 1.176 fa.po, 1.92, 1.93 fr.po, 1.238, 1.239 grisbi.pot, 1.140, 1.141 he.po, 1.98, 1.99 it.po, 1.98, 1.99 nl.po, 1.97, 1.98 pl.po, 1.103, 1.104 pt_BR.po, 1.100, 1.101 ro.po, 1.99, 1.100 ru.po, 1.97, 1.98 zh_CN.po, 1.93, 1.94
- Next message: [grisbi-cvs] grisbi/src gsb_real.c,1.71,1.72
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3535
Modified Files:
gsb_real.c
Log Message:
minor correction
Index: gsb_real.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_real.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- gsb_real.c 28 Feb 2010 08:40:57 -0000 1.70
+++ gsb_real.c 8 Mar 2010 22:31:53 -0000 1.71
@@ -369,9 +369,13 @@
static gchar *decimal_chars;
static const gchar *positive_chars = "+";
static const gchar *negative_chars = "-";
-
- unsigned mts_len;
- unsigned mdp_len;
+ static const gchar *decimal_char_dot = ".";
+ static const gchar *decimal_char_comma = ",";
+ static const gchar *empty_char = "" ;
+ const gchar *default_decimal_char_dot = decimal_char_dot;
+ const gchar *default_decimal_char_comma = decimal_char_comma;
+ unsigned mts_len;
+ unsigned mdp_len;
unsigned nb_digits = 0;
gint64 mantissa = 0;
gint8 sign = 0;
@@ -385,11 +389,19 @@
? strlen ( mon_thousands_sep )
: 0;
mdp_len = mon_decimal_point ? strlen ( mon_decimal_point ) : 0;
- if ( !strchr ( mon_thousands_sep, '.' ))
- decimal_chars = g_strconcat(".", mon_decimal_point, NULL);
- else
- decimal_chars = g_strdup(mon_decimal_point);
- space_chars = g_strconcat(" ", mon_thousands_sep, NULL);
+
+ if ( mon_thousands_sep )
+ {
+ if ( g_strstr_len ( mon_thousands_sep, -1, decimal_char_dot ) )
+ default_decimal_char_dot = empty_char;
+ if ( g_strstr_len ( mon_thousands_sep, -1, decimal_char_comma ) )
+ default_decimal_char_comma = empty_char ;
+ }
+
+ decimal_chars = g_strconcat(default_decimal_char_dot,
+ default_decimal_char_comma,
+ mon_decimal_point,
+ NULL);
for ( ; ; )
{
@@ -412,7 +424,7 @@
: 0;
return result;
}
- else if ( strchr ( decimal_chars, *p ) )
+ else if ( decimal_chars && strchr ( decimal_chars, *p ) )
{
if ( dot_position >= 0 ) // already found a decimal separator
return error_real;
@@ -443,6 +455,9 @@
return error_real;
}
}
+ /* Free memory */
+ g_free ( decimal_chars );
+ g_free ( space_chars );
}
- Previous message: [grisbi-cvs] grisbi/po cs.po, 1.99, 1.100 da.po, 1.105, 1.106 de.po, 1.179, 1.180 el.po, 1.69, 1.70 eo.po, 1.62, 1.63 es.po, 1.175, 1.176 fa.po, 1.92, 1.93 fr.po, 1.238, 1.239 grisbi.pot, 1.140, 1.141 he.po, 1.98, 1.99 it.po, 1.98, 1.99 nl.po, 1.97, 1.98 pl.po, 1.103, 1.104 pt_BR.po, 1.100, 1.101 ro.po, 1.99, 1.100 ru.po, 1.97, 1.98 zh_CN.po, 1.93, 1.94
- Next message: [grisbi-cvs] grisbi/src gsb_real.c,1.71,1.72
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cvs
mailing list