1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## httptime.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix for non en locales
@DPATCH@
diff -urNad aolserver4-4.0.10~/nsd/httptime.c aolserver4-4.0.10/nsd/httptime.c
--- aolserver4-4.0.10~/nsd/httptime.c 2003-01-18 20:24:20.000000000 +0100
+++ aolserver4-4.0.10/nsd/httptime.c 2005-11-10 00:05:53.000000000 +0100
@@ -27,6 +27,9 @@
* version of this file under either the License or the GPL.
*/
+static char *weekdays_names[7] =
+{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+
/*
* time.c --
@@ -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;
|