From: Sami Kerola Date: Sun, 16 Jun 2013 18:53:45 +0000 (+0100) Subject: sfdisk: use program_invocation_short_name to determine program name X-Git-Tag: v2.24-rc1~481 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c2020990b4c983f8cd8d3db600d3e70c7d62774;p=thirdparty%2Futil-linux.git sfdisk: use program_invocation_short_name to determine program name Signed-off-by: Sami Kerola --- diff --git a/fdisks/sfdisk.c b/fdisks/sfdisk.c index 96b4de2d8d..2b4969b02f 100644 --- a/fdisks/sfdisk.c +++ b/fdisks/sfdisk.c @@ -2535,7 +2535,6 @@ unsigned long long total_size; int main(int argc, char **argv) { - char *progn; int c; char *dev; int opt_size = 0; @@ -2555,14 +2554,10 @@ main(int argc, char **argv) { if (argc < 1) errx(EXIT_FAILURE, _("no command?")); - if ((progn = strrchr(argv[0], '/')) == NULL) - progn = argv[0]; - else - progn++; - if (!strcmp(progn, "activate")) + if (!strcmp(program_invocation_short_name, "activate")) activate = 1; /* equivalent to `sfdisk -A' */ #if 0 /* not important enough to deserve a name */ - else if (!strcmp(progn, "unhide")) + else if (!strcmp(program_invocation_short_name, "unhide")) unhide = 1; /* equivalent to `sfdisk -U' */ #endif