Commit 3a0670e0 authored by Adrian Johnson's avatar Adrian Johnson

tag_attributes: Allow decimal points in non decimal point locales

Issue #347
parent 4804d073
Pipeline #13561 failed with stage
in 6 minutes and 42 seconds
......@@ -217,9 +217,28 @@ static const char *
parse_float (const char *p, double *d)
{
int n;
const char *start = p;
cairo_bool_t has_decimal_point = FALSE;
if (sscanf(p, "%lf%n", d, &n) > 0)
return p + n;
while (*p) {
if (*p == '.' || *p == ']' || _cairo_isspace (*p))
break;
p++;
}
if (*p == '.')
has_decimal_point = TRUE;
if (has_decimal_point) {
char *end;
*d = _cairo_strtod (start, &end);
if (end)
return end;
} else {
if (sscanf(start, "%lf%n", d, &n) > 0)
return start + n;
}
return NULL;
}
......
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