Commit d618cfc9 d618cfc92d0abc1ecb85172419c1360db41597e7 by Sergey Poznyakoff

(fetch_internaldate): Use mu_parse_ctime_date_time.

1 parent d97007c5
...@@ -341,18 +341,18 @@ fetch_flags (struct fetch_command *command, char **arg) ...@@ -341,18 +341,18 @@ fetch_flags (struct fetch_command *command, char **arg)
341 static int 341 static int
342 fetch_internaldate (struct fetch_command *command, char **arg) 342 fetch_internaldate (struct fetch_command *command, char **arg)
343 { 343 {
344 char date[128]; 344 char date[128], *p;
345 envelope_t env = NULL; 345 envelope_t env = NULL;
346 struct tm *tptr; 346 struct tm tm;
347 time_t env_time; 347 mu_timezone tz;
348 348
349 (void)arg; /* No arguments. */ 349 (void)arg; /* No arguments. */
350 message_get_envelope (command->msg, &env); 350 message_get_envelope (command->msg, &env);
351 date[0] = '\0'; 351 date[0] = '\0';
352 envelope_date (env, date, sizeof (date), NULL); 352 envelope_date (env, date, sizeof (date), NULL);
353 util_parse_ctime_date (date, &env_time); 353 p = date;
354 tptr = gmtime(&env_time); 354 mu_parse_ctime_date_time (&p, &tm, &tz);
355 strftime (date, sizeof (date), "%d-%b-%Y %X", tptr); 355 strftime (date, sizeof (date), "%d-%b-%Y %X", &tm);
356 util_send ("%s", command->name); 356 util_send ("%s", command->name);
357 util_send (" \"%s +0000\"", date); 357 util_send (" \"%s +0000\"", date);
358 return RESP_OK; 358 return RESP_OK;
......