Commit a159d5d5 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

strings with only spaces are NOT numbers.


2000-06-20  Jody Goldberg <jgoldberg@home.com>

	* src/number-match.c (format_match) : strings with only spaces are NOT
	  numbers.
parent 5e94ceb3
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
2000-06-20 Jody Goldberg <jgoldberg@home.com>
* src/number-match.c (format_match) : strings with only spaces are NOT
numbers.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
......
......@@ -902,7 +902,7 @@ format_match (const char *text, StyleFormat **format)
{
char *end;
long l = strtol (text, &end, 10);
if (errno != ERANGE) {
if (text != end && errno != ERANGE) {
/* ignore spaces at the end . */
while (*end == ' ')
end++;
......@@ -915,11 +915,13 @@ format_match (const char *text, StyleFormat **format)
{
char *end;
double d = strtod (text, &end);
/* Allow and ignore spaces at the end . */
while (*end == ' ')
end++;
if (text != end && *end == '\0' && d == (float_t)d)
return value_new_float ((float_t)d);
if (text != end && errno != ERANGE) {
/* Allow and ignore spaces at the end . */
while (*end == ' ')
end++;
if (text != end && *end == '\0' && d == (float_t)d)
return value_new_float ((float_t)d);
}
}
/* Fall back to checking the set of canned formats */
......
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