Skip to content

Commit

Permalink
refactor: update tmp_path var
Browse files Browse the repository at this point in the history
Use more descriptive names for mmv's
- temporary editing buffer
- the temporary editing buffer variable
  • Loading branch information
mcauley-penney committed Dec 7, 2023
1 parent 4aeefa5 commit 751c988
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 751c988

Please sign in to comment.