aboutsummaryrefslogtreecommitdiff
path: root/lib/file.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-11 00:03:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-11 00:03:49 +0000
commite7cefd684b2d5e1f3710eb24babc0b9974095c97 (patch)
tree72dda2856434104644eb419a90c53e77a677d990 /lib/file.c
parentd2485e4f2083997c3e3b552342c77649f1ee522e (diff)
Removed all uses of strftime() since it uses the localised version of the
week day names and month names and servers don't like that.
Diffstat (limited to 'lib/file.c')
-rw-r--r--lib/file.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/file.c b/lib/file.c
index 5bebf3287..c325a4673 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -87,6 +87,7 @@
#include "transfer.h"
#include "url.h"
#include "memory.h"
+#include "parsedate.h" /* for the week day and month names */
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -321,7 +322,6 @@ CURLcode Curl_file(struct connectdata *conn, bool *done)
if(result)
return result;
-#ifdef HAVE_STRFTIME
if(fstated) {
struct tm *tm;
time_t clock = (time_t)statbuf.st_mtime;
@@ -332,11 +332,17 @@ CURLcode Curl_file(struct connectdata *conn, bool *done)
tm = gmtime(&clock);
#endif
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
- strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
- tm);
+ snprintf(buf, BUFSIZE-1,
+ "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
+ Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
+ tm->tm_mday,
+ Curl_month[tm->tm_mon],
+ tm->tm_year + 1900,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec);
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
}
-#endif
return result;
}