--- mod_negotiation.c.orig Fri Feb 4 23:21:18 2005 +++ mod_negotiation.c Sat Apr 15 20:57:16 2006 @@ -337,6 +337,25 @@ * HTTPD header lines and elsewhere. */ +static float ap_atoq(const char *str) { + float result1 = atof(str); + float result2 = 0.0; + char *p = strchr(str, '.'), *d; + + if (p != NULL) { + *p = ','; + result2 = atof(str); + } else { + d = strchr(str, ','); + if (d != NULL) { + *d = '.'; + result2 = atof(str); + } + } + if (result2 > result1) return result2; + return result1; +} + /* * Get a single mime type entry --- one media type and parameters; * enter the values we recognize into the argument accept_rec @@ -420,10 +439,10 @@ if (parm[0] == 'q' && (parm[1] == '\0' || (parm[1] == 's' && parm[2] == '\0'))) { - result->quality = (float)atof(cp); + result->quality = (float)ap_atoq(cp); } else if (parm[0] == 'l' && !strcmp(&parm[1], "evel")) { - result->level = (float)atof(cp); + result->level = (float)ap_atoq(cp); } else if (!strcmp(parm, "charset")) { result->charset = cp;