From 86b78519e7aa5b4a5c3d396de1181fd472099b87 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 11 Jul 2021 11:13:05 -0400 Subject: Replace `%c` in the time format string with the RFC 2822 date format. --- git.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/git.c b/git.c index 490782c..4a5e871 100644 --- a/git.c +++ b/git.c @@ -75,7 +75,7 @@ int get_info_len(pull_request *pr) { localtime_r(&pr->date, &tm); len += format_len("author: %s\n", pr->author); - len += format_len("date: ") + strftime(NULL, -1, "%c %z\n", &tm); + len += format_len("date: ") + strftime(NULL, -1, "%a %b %e %H:%M:%S %Y %z\n", &tm); len += format_len("description: %s\n", pr->desc); len += format_len("type: %i\n", pr->pr_type); @@ -123,7 +123,7 @@ int create_info_file(pull_request *pr, const char *pr_root) { j = sprintf(file_buf, "title: %s\n", pr->title); j += sprintf(file_buf+j, "author: %s\n", pr->author); j += sprintf(file_buf+j, "date: "); - j += strftime(file_buf+j, -1, "%c %z\n", &tm); + j += strftime(file_buf+j, -1, "%a %b %e %H:%M:%S %Y %z\n", &tm); j += sprintf(file_buf+j, "description: %s\n", pr->desc); j += sprintf(file_buf+j, "type: %i\n", pr->pr_type); @@ -188,14 +188,14 @@ int get_comment_len(comment *comment) { len = format_len("id: %i\n", comment->id); len += format_len("author: %s\n", comment->author); - len += format_len("date: ") + strftime(NULL, -1, "%c %z\n", &tm); + len += format_len("date: ") + strftime(NULL, -1, "%a %b %e %H:%M:%S %Y %z\n", &tm); /* Is this comment a reply? */ if (comment->reply != NULL) { localtime_r(&comment->reply->date, &tm); len += format_len("reply-to: %i\n", comment->reply->id); len += format_len("reply-author: %s\n", comment->reply->author); - len += format_len("reply-date: ") + strftime(NULL, -1, "%c %z\n", &tm); + len += format_len("reply-date: ") + strftime(NULL, -1, "%a %b %e %H:%M:%S %Y %z\n", &tm); } len += format_len("description: %s\n\n", comment->desc); @@ -234,7 +234,7 @@ int add_comment(comment *comment, const char *pr_root) { j = sprintf(file_buf, "id: %i\n", comment->id); j += sprintf(file_buf+j, "author: %s\n", comment->author); j += sprintf(file_buf+j, "date: "); - j += strftime(file_buf+j, -1, "%c %z\n", &tm); + j += strftime(file_buf+j, -1, "%a %b %e %H:%M:%S %Y %z\n", &tm); /* Is this comment a reply? */ if (comment->reply != NULL) { @@ -242,7 +242,7 @@ int add_comment(comment *comment, const char *pr_root) { j += sprintf(file_buf+j, "reply-to: %i\n", comment->reply->id); j += sprintf(file_buf+j, "reply-author: %s\n", comment->reply->author); j += sprintf(file_buf+j, "reply-date: "); - j += strftime(file_buf+j, -1, "%c %z\n", &tm); + j += strftime(file_buf+j, -1, "%a %b %e %H:%M:%S %Y %z\n", &tm); } j += sprintf(file_buf+j, "description: %s\n\n", comment->desc); -- cgit v1.2.3-13-gbd6f