From dc1854a326b44ec82ce371cab672ea81f40d8a95 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 1 Aug 2021 12:31:11 -0400 Subject: Replace all instances of `dir_path_name()`, with `sanitized_dir_path_name()` in `create_pull_request_dir()`. --- git.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git.c b/git.c index 230d6e9..66e5bfb 100644 --- a/git.c +++ b/git.c @@ -302,7 +302,8 @@ int create_pull_request_dir(pull_request *pr, int id, const char *root) { } /* Get the path of the PR's directory. */ - pr_dir = (pr->title != NULL && pr->title[0] != '\0') ? dir_path_name(root, sanitize_str(pr->title)) : dir_path_num(root, id); + pr_dir = (pr->title != NULL && pr->title[0] != '\0') ? sanitized_dir_path_name(root, pr->title) : dir_path_num(root, id); + /* Is there no existing directory? */ if (stat(pr_dir, &st) < 0) { @@ -326,7 +327,9 @@ int create_pull_request_dir(pull_request *pr, int id, const char *root) { FILE *fp; /*char *filename = dir_path_name(root, sanitize_str(create_num_str(commits[i]->name, i)));*/ char *filename = create_num_str(commits[i]->name, i); - char *file = dir_path_name(root, sanitize_str(filename)); + char *file = sanitized_dir_path_name(root, filename); + + free(san_filename); /* Does this patch file exists? */ if (access(file, F_OK) == 0) { -- cgit v1.2.3-13-gbd6f