summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-07-30 14:20:36 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-07-30 14:20:36 -0300
commit5524b1730736c01d7b6172d2cc250b85cbf748d2 (patch)
tree8e0d31a11c589fc58978bb8b8979d1f24261927d /git.c
parentcff52c5423f9beabbbb857e16f1e36bba4efad8d (diff)
git: Properly sanitize, and format the patch file name in
`parse_patch_list()`
Diffstat (limited to 'git.c')
-rw-r--r--git.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/git.c b/git.c
index 70be9a2..befdaa3 100644
--- a/git.c
+++ b/git.c
@@ -107,9 +107,14 @@ int parse_patch_list(void *ctx, void *ret, const keyword *key, keyword_val val)
pr->patches[num_patches--] = NULL;
/* For each patch file in the list. */
for (linked_list *patch = patch_list; patch != NULL; patch = patch->prev, --num_patches) {
- const char *patch_file = (const char *)patch->data;
+ char *patch_file = create_num_str((const char *)patch->data, num_patches);
+ char *sanitized_patch_file = sanitize_str(patch_file);
/* Create a new entry in the list. */
pr->patches[num_patches] = create_file(root, patch_file);
+ pr->patches[num_patches]->name = (char *)patch->data;
+ free(patch_file);
+ free(sanitized_patch_file);
+
}
cleanup_linked_list(patch_list);