From 4ba7b8861340453622d6e53eecb2fe52ea8fa32b Mon Sep 17 00:00:00 2001 From: Patrick Rouleau Date: Tue, 15 Jul 2014 07:00:47 -0400 Subject: [PATCH] Fix get_exec_name(): when partclone is installed, there is no '/' in 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 --- src/partclone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/partclone.c b/src/partclone.c index bf3400f4..21558888 100644 --- a/src/partclone.c +++ b/src/partclone.c @@ -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; } }