summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-04-21 11:49:40 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-06-27 14:52:50 +0300
commit440bb02fd771bad7389599d4c256e3f531f7b545 (patch)
tree82561ae0bacb6c1360e37ff4247331411df33b37
parent6ff70e3763a32f2b33622d277795c7a8c0aaa91b (diff)
downloadabuild-440bb02fd771bad7389599d4c256e3f531f7b545.tar.gz
abuild-440bb02fd771bad7389599d4c256e3f531f7b545.tar.bz2
abuild-440bb02fd771bad7389599d4c256e3f531f7b545.tar.xz
abuild-440bb02fd771bad7389599d4c256e3f531f7b545.zip
abuild-sudo: allow commands with '-' in the name
-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++;