summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-07-11 11:13:05 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-07-11 11:16:25 -0400
commit86b78519e7aa5b4a5c3d396de1181fd472099b87 (patch)
tree19164674de0ea6efc4aca0b480ca869fcb15a726 /git.c
parent1936a4303eae6dc1cc7ce072d87e3f8f365f4e64 (diff)
Replace `%c` in the time format string with the RFC
2822 date format.
Diffstat (limited to 'git.c')
-rw-r--r--git.c12
1 files 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);