From b484c8132030a701f2c51dc24e88a773d09012a4 Mon Sep 17 00:00:00 2001 From: dtb Date: Sun, 20 Nov 2022 20:35:09 -0500 Subject: [PATCH] subtle bug fix --- pscat/Makefile | 2 +- pscat/pscat.c | 21 +++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pscat/Makefile b/pscat/Makefile index 7ed88ab..0353c73 100644 --- a/pscat/Makefile +++ b/pscat/Makefile @@ -5,7 +5,7 @@ TARGETS = pscat all: $(TARGETS) clean: - $(RM) $(TARGETS) + $(RM) $(TARGETS) *.o debug: $(CC) $(DEBUG) -o pscat pscat.c diff --git a/pscat/pscat.c b/pscat/pscat.c index 2ab41bb..b8c8a93 100644 --- a/pscat/pscat.c +++ b/pscat/pscat.c @@ -1,33 +1,22 @@ #include +#include #include #include -#ifndef DONT_USE_SYSTEM_SYSEXITS -# include -#else -# include "../sysexits/sysexits.h" -#endif /* ifndef DONT_USE_SYSTEM_SYSEXITS */ - #include "psargs.h" static char *program_name = "pscat"; /* Originally designed to use parentheses but changed to brackets to escape the * hassle of escaping them from the Bourne shell. */ -#ifndef USE_ASCII_H -# define L_PAREN '[' -# define R_PAREN ']' -#else -# include "../ascii/ascii.h" -# define L_PAREN ASCII_LEFT_SQUARE_BRACKET -# define R_PAREN ASCII_RIGHT_SQUARE_BRACKET -#endif /* ifndef USE_ASCII_H */ +#define L_PAREN '[' +#define R_PAREN ']' int main(int argc, char *argv[]){ char **psstart; int child; int i; - int retval; + unsigned int retval; int terms; retval = 0; @@ -35,7 +24,7 @@ int main(int argc, char *argv[]){ if((terms = check_arg(++argv, L_PAREN, R_PAREN)) == 0){ fprintf(stderr, "Usage: %s \"[\" [utility [argument...]] \"]\" ...\n", - argv[0] == NULL ? program_name : argv[0] + argv[-1] == NULL ? program_name : argv[-1] ); return EX_USAGE; }