diff options
| author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-30 14:20:36 -0300 |
|---|---|---|
| committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-30 14:20:36 -0300 |
| commit | 5524b1730736c01d7b6172d2cc250b85cbf748d2 (patch) | |
| tree | 8e0d31a11c589fc58978bb8b8979d1f24261927d | |
| parent | cff52c5423f9beabbbb857e16f1e36bba4efad8d (diff) | |
git: Properly sanitize, and format the patch file name in
`parse_patch_list()`
| -rw-r--r-- | git.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |
