Skip to content

Commit

Permalink
[mv] Avoid calling normalize_dest() when it's not required.
Browse files Browse the repository at this point in the history
  • Loading branch information
duckinator committed Aug 28, 2020
1 parent 8f3f966 commit 3ad2d46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ int main(int argc, char **argv) {
}

for (; i < argc - 1; i++) {
char *normalized_dest = normalize_dest(argv[i], dest);
if (should_prompt && access(normalized_dest, F_OK) == 0) {
if (prompt(normalized_dest) == 0) {
continue;
if (should_prompt) {
char *normalized_dest = normalize_dest(argv[i], dest);
if (access(normalized_dest, F_OK) == 0) {
if (prompt(normalized_dest) == 0) {
continue;
}
}
}

Expand Down

0 comments on commit 3ad2d46

Please sign in to comment.