summaryrefslogtreecommitdiff
path: root/abuild-sudo.c
diff options
context:
space:
mode:
Diffstat (limited to 'abuild-sudo.c')
-rw-r--r--abuild-sudo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/abuild-sudo.c b/abuild-sudo.c
index 9377756..1e51b5d 100644
--- a/abuild-sudo.c
+++ b/abuild-sudo.c
@@ -80,7 +80,12 @@ int main(int argc, const char *argv[])
name ? name : "(unknown)", ABUILD_GROUP);
}
- cmd = strrchr(argv[0], '-');
+ cmd = strrchr(argv[0], '/');
+ if (cmd)
+ cmd++;
+ else
+ cmd = argv[0];
+ cmd = strchr(cmd, '-');
if (cmd == NULL)
errx(1, "Calling command has no '-'");
cmd++;