X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/629397607379b4192dd933b4ab760009bfa32f6d..6d713a99954cf8f800ebf06894840cbd5c6e89ba:/usr/src/usr.bin/ptx/ptx.c diff --git a/usr/src/usr.bin/ptx/ptx.c b/usr/src/usr.bin/ptx/ptx.c index 6c5e0b966c..dbce655129 100644 --- a/usr/src/usr.bin/ptx/ptx.c +++ b/usr/src/usr.bin/ptx/ptx.c @@ -1,5 +1,6 @@ -static char *sccsid = "@(#)ptx.c 4.2 (Berkeley) %G%"; -# +#ifndef lint +static char *sccsid = "@(#)ptx.c 4.4 (Berkeley) %G%"; +#endif /* not lint */ /* permuted title index ptx [-t] [-i ignore] [-o only] [-w num] [-f] [input] [output] @@ -14,7 +15,6 @@ static char *sccsid = "@(#)ptx.c 4.2 (Berkeley) %G%"; the -t flag says the output is for troff and the output is then wider. - make: cc ptx.c -lS */ #include @@ -58,7 +58,7 @@ FILE *inptr = stdin; char *outfile; FILE *outptr = stdout; -char *sortfile; /* output of sort program */ +char sortfile[] = "/tmp/ptxsXXXXX"; /* output of sort program */ char nofold[] = {'-', 'd', 't', TILDE, 0}; char fold[] = {'-', 'd', 'f', 't', TILDE, 0}; char *sortopt = nofold; @@ -216,7 +216,7 @@ char **argv; /* open output file for sorting */ - sortfile = mktemp("/tmp/ptxsXXXXX"); + mktemp(sortfile); if((sortptr = fopen(sortfile, "w")) == NULL) diag("Cannot open output for sorting:",sortfile); @@ -245,8 +245,7 @@ char **argv; getsort(); - if(*sortfile) - unlink(sortfile); + unlink(sortfile); exit(0); } @@ -500,8 +499,7 @@ char *strt, *end; onintr() { - if(*sortfile) - unlink(sortfile); + unlink(sortfile); exit(1); }