[PATCH 04/15] sfdisk: use program_invocation_short_name to determine program name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 fdisks/sfdisk.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/fdisks/sfdisk.c b/fdisks/sfdisk.c
index 96b4de2..2b4969b 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
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux