aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-09-11 19:19:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-09-11 19:19:59 +0000
commit27d509cfe9c4cea74c94c9dc722f1068d17f731f (patch)
tree50615192b94f8af72e62e50a663c7ae648989aeb
parentade8e47a8c4092c47081c2f9c6adbd968ee87dc7 (diff)
Minor adjustment needed for the new date parser to succeed. ifdef'ed out
for now.
-rw-r--r--lib/ftp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 67d6ddacb..64097c646 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -903,6 +903,10 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
return CURLE_OK;
}
+#ifdef NEW_DATE_PARSE
+extern const char *Curl_month[];
+#endif
+
/***********************************************************************
*
* ftp_getfiletime()
@@ -935,9 +939,17 @@ CURLcode ftp_getfiletime(struct connectdata *conn, char *file)
&year, &month, &day, &hour, &minute, &second)) {
/* we have a time, reformat it */
time_t secs=time(NULL);
+#ifdef NEW_DATE_PARSE
+ /* using the new date parser */
+ snprintf(buf, sizeof(conn->data->state.buffer),
+ "%s %02d %02d:%02d:%02d %04d GMT",
+ Curl_month[month-1], day, hour, minute, second, year);
+#else
+ /* using the good old yacc/bison yuck */
snprintf(buf, sizeof(conn->data->state.buffer),
"%04d%02d%02d %02d:%02d:%02d GMT",
year, month, day, hour, minute, second);
+#endif
/* now, convert this into a time() value: */
conn->data->info.filetime = curl_getdate(buf, &secs);
}