aboutsummaryrefslogtreecommitdiff
path: root/lib/file.c
diff options
context:
space:
mode:
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;
}