From 7781d3baef7448f427f740ee2b6b9ad56d449c76 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 27 Jun 2021 10:59:06 -0400 Subject: Renamed `info` to `filename` in `create_info_file()`. --- git.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/git.c b/git.c index ca7208a..e8a1274 100644 --- a/git.c +++ b/git.c @@ -97,7 +97,7 @@ int create_info_file(pull_request *pr, const char *pr_root) { int len; int buf_len; int j = 0; - char *info; + char *filename; char *info_buf; FILE *fp; struct tm tm; @@ -107,7 +107,7 @@ int create_info_file(pull_request *pr, const char *pr_root) { log(LOG_ERR,"Pull request is NULL."); return 0; } - /* Is the PR directory NULL? */ + /* Is the PR root NULL? */ if (pr_root == NULL) { log(LOG_ERR,"Pull request root is NULL."); return 0; @@ -117,7 +117,7 @@ int create_info_file(pull_request *pr, const char *pr_root) { len = strlen(pr_root) + strlen("/info"); buf_len = get_info_len(pr); - info = calloc(len+1, sizeof(char)); + filename = calloc(len+1, sizeof(char)); info_buf = calloc(buf_len+1, sizeof(char)); j = sprintf(info_buf, "title: %s\n", pr->title); @@ -139,12 +139,12 @@ int create_info_file(pull_request *pr, const char *pr_root) { } /* Append /info to the PR root. */ - sprintf(info, "%s/info", pr_root); + sprintf(filename, "%s/info", pr_root); /* Is there already an info file? */ - if (access(info, F_OK) == 0) { + if (access(filename, F_OK) == 0) { long size = 0; - char *buf = read_file(info, &size); + char *buf = read_file(filename, &size); log(LOG_NOTICE, "Info file already exists."); @@ -153,7 +153,7 @@ int create_info_file(pull_request *pr, const char *pr_root) { /* Are the contents of the info file the same? */ if (strcmp(info_buf, buf) == 0) { log(LOG_NOTICE, "New info file is the same as the existing one."); - free(info); + free(filename); free(info_buf); free(buf); return 2; @@ -166,7 +166,7 @@ int create_info_file(pull_request *pr, const char *pr_root) { } /* Open the info file. */ - fp = fopen(info, "w"); + fp = fopen(filename, "w"); /* Did we fail to open the file? */ if (fp == NULL) { -- cgit v1.2.3-13-gbd6f