From 751c988615827dedc52580e0a689ab8afa067cfd Mon Sep 17 00:00:00 2001 From: McAuley Penney Date: Wed, 6 Dec 2023 11:17:40 -0700 Subject: [PATCH] refactor: update tmp_path var Use more descriptive names for mmv's - temporary editing buffer - the temporary editing buffer variable --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 37a4050..cc891ed 100644 --- a/main.c +++ b/main.c @@ -71,15 +71,15 @@ int main(int argc, char *argv[]) if (src_set == NULL) goto free_opts_out; - char tmp_path[] = "/tmp/mmv_XXXXXX"; + char tmpfile[] = "/tmp/mmv_editbuf_XXXXXX"; - if (write_strarr_to_tmpfile(src_set, tmp_path) != 0) + if (write_strarr_to_tmpfile(src_set, tmpfile) != 0) goto free_src_out; - if (edit_tmpfile(tmp_path) != 0) + if (edit_tmpfile(tmpfile) != 0) goto rm_path_out; - struct Set *dest_set = init_dest_set(src_set->num_keys, tmp_path); + struct Set *dest_set = init_dest_set(src_set->num_keys, tmpfile); if (dest_set == NULL) goto rm_path_out; @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) rename_paths(src_set, dest_set, options); set_destroy(dest_set); - rm_path(tmp_path); + remove(tmpfile); set_destroy(src_set); free(options); @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) set_destroy(dest_set); rm_path_out: - rm_path(tmp_path); + remove(tmpfile); free_src_out: set_destroy(src_set);