Skip to content

Commit

Permalink
Fix get_exec_name(): when partclone is installed, there is no '/' in …
Browse files Browse the repository at this point in the history
…argv0

I forgot to test the case where partclone can be found through PATH and
in that case argv[0] does not contains a slash.

Signed-off-by: Patrick Rouleau <pfrouleau@gmail.com>
  • Loading branch information
pfrouleau committed Feb 12, 2021
1 parent 378158f commit 4ba7b88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/partclone.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,9 @@ static void save_program_name(const char* argv0) {
const char* last_slash = strrchr(argv0, '/');

if (last_slash != 0) {

exec_name = last_slash + 1;
} else {
exec_name = argv0;
}
}

Expand Down

0 comments on commit 4ba7b88

Please sign in to comment.