summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-27 10:59:06 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-27 10:59:06 -0400
commit7781d3baef7448f427f740ee2b6b9ad56d449c76 (patch)
tree8b6e97e9aa5843c4d256792b50df9119e899c0aa /git.c
parentc8b3e73d3645c80ef60d2c1ea35fabe2516dc767 (diff)
Renamed `info` to `filename` in `create_info_file()`.
Diffstat (limited to 'git.c')
-rw-r--r--git.c16
1 files 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) {