Commit 49efbf9b authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

fixed a bug that caused floats of the format ".xxx" to be parsed as "xxx".

Mon Apr  6 18:43:25 1998  Tim Janik  <timj@gtk.org>

        * gscanner.c (g_scanner_get_token_ll): fixed a bug that caused floats
                of the format ".xxx" to be parsed as "xxx".
parent 0f9fe897
Mon Apr 6 18:43:25 1998 Tim Janik <timj@gtk.org>
* gscanner.c (g_scanner_get_token_ll): fixed a bug that caused floats
of the format ".xxx" to be parsed as "xxx".
Fri Apr 3 20:36:35 1998 Owen Taylor <owt1@cornell.edu> Fri Apr 3 20:36:35 1998 Owen Taylor <owt1@cornell.edu>
* gutils.c (g_parse_debug_string): Make debug string * gutils.c (g_parse_debug_string): Make debug string
......
...@@ -641,6 +641,8 @@ g_scanner_get_token_ll (GScanner *scanner, ...@@ -641,6 +641,8 @@ g_scanner_get_token_ll (GScanner *scanner,
do do
{ {
register gboolean dotted_float = FALSE;
ch = g_scanner_get_char (scanner, line_p, position_p); ch = g_scanner_get_char (scanner, line_p, position_p);
value.v_int = 0; value.v_int = 0;
...@@ -796,6 +798,7 @@ g_scanner_get_token_ll (GScanner *scanner, ...@@ -796,6 +798,7 @@ g_scanner_get_token_ll (GScanner *scanner,
if (!config->scan_float) if (!config->scan_float)
goto default_case; goto default_case;
token = G_TOKEN_FLOAT; token = G_TOKEN_FLOAT;
dotted_float = TRUE;
ch = g_scanner_get_char (scanner, line_p, position_p); ch = g_scanner_get_char (scanner, line_p, position_p);
goto number_parsing; goto number_parsing;
...@@ -868,7 +871,7 @@ g_scanner_get_token_ll (GScanner *scanner, ...@@ -868,7 +871,7 @@ g_scanner_get_token_ll (GScanner *scanner,
if (token == G_TOKEN_NONE) if (token == G_TOKEN_NONE)
token = G_TOKEN_INT; token = G_TOKEN_INT;
gstring = g_string_new (""); gstring = g_string_new (dotted_float ? "0." : "");
gstring = g_string_append_c (gstring, ch); gstring = g_string_append_c (gstring, ch);
in_number = TRUE; in_number = TRUE;
while (in_number) while (in_number)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment