From 361b34c50f13e32d6c2c67263253d791f665687b Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 29 Jul 2024 02:35:01 -0600 Subject: [PATCH] npc(1): improves program_name resolution --- src/npc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/npc.c b/src/npc.c index 4cc4160..2e256b0 100644 --- a/src/npc.c +++ b/src/npc.c @@ -36,9 +36,10 @@ int main(int argc, char *argv[]) { int c; char showend = 0; /* print a dollar sign before each newline */ char showtab = 0; /* prints tab characters in caret notation */ - program_name = (argv[0] == NULL ? program_name : argv[0]); if (argc > 0) { + program_name = argv[0]; + while ((c = getopt(argc, argv, "et")) != -1) { switch (c){ case 'e': showend = 1; break;