Package: aolserver4 Version: 4.0.10-3 Severity: normal
This patch fixes the locale problem of ns_httptime where it could output the "standard" time format of ns_httptime in other languages instead of english.
--- aolserver/nsd/httptime.c +++ aolserver/nsd/httptime.c @@ -56,6 +56,9 @@ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; +static char *weekdays_names[7] = +{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + /* *---------------------------------------------------------------------- @@ -92,11 +95,14 @@ } /* - * This will most likely break if the locale is not an english one. + * Using snprintf instead of strftime to always use english names * The format is RFC 1123: "Sun, 06 Nov 1997 09:12:45 GMT" */ - strftime(buf, 40, "%a, %d %b %Y %H:%M:%S GMT", tmPtr); + snprintf(buf, 40, "%s, %d %s %d %02d:%02d:%02d GMT", + weekdays_names[tmPtr->tm_wday], tmPtr->tm_mday, + month_names[tmPtr->tm_mon], tmPtr->tm_year + 1900, + tmPtr->tm_hour, tmPtr->tm_min, tmPtr->tm_sec); Ns_DStringAppend(pds, buf); return pds->string;