1
0

subtle bug fix

This commit is contained in:
dtb 2022-11-20 20:35:09 -05:00
parent 19f091eead
commit b484c81320
2 changed files with 6 additions and 17 deletions

View File

@ -5,7 +5,7 @@ TARGETS = pscat
all: $(TARGETS)
clean:
$(RM) $(TARGETS)
$(RM) $(TARGETS) *.o
debug:
$(CC) $(DEBUG) -o pscat pscat.c

View File

@ -1,33 +1,22 @@
#include <stdio.h>
#include <sysexits.h>
#include <unistd.h>
#include <sys/wait.h>
#ifndef DONT_USE_SYSTEM_SYSEXITS
# include <sysexits.h>
#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;
}