X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/2b84abb596f52ab2068d52108adc96838ad4340a..31cef89cb428866f787983e68246030321893df4:/usr/src/cmd/sort.c diff --git a/usr/src/cmd/sort.c b/usr/src/cmd/sort.c index bccb330d29..2be25eef89 100644 --- a/usr/src/cmd/sort.c +++ b/usr/src/cmd/sort.c @@ -1,3 +1,4 @@ +static char *sccsid = "@(#)sort.c 4.2 (Berkeley) 10/9/80"; #include #include #include @@ -176,7 +177,6 @@ char **argv; char *arg; struct field *p, *q; int i; - unsigned pid; copyproto(); eargv = argv; @@ -260,11 +260,14 @@ char **argv; exit(1); } close(a); - signal(SIGHUP, term); + unlink(file); + if (signal(SIGHUP, SIG_IGN) != SIG_IGN) + signal(SIGHUP, term); if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, term); signal(SIGPIPE,term); - signal(SIGTERM,term); + if (signal(SIGTERM, SIG_IGN) != SIG_IGN) + signal(SIGTERM,term); nfiles = eargc; if(!mflg && !cflg) { sort(); @@ -560,7 +563,7 @@ term() for(i=eargc; i<=nfiles; i++) { /*<= in case of interrupt*/ unlink(setfil(i)); /*with nfiles not updated*/ } - exit(error); + _exit(error); } cmp(i, j) @@ -591,6 +594,12 @@ char *i, *j; lb = eol(pb); } if(fp->nflg) { + if(tabchar) { + if(pa0||j==0) + p++; } else { while(blank(*p)) p++; @@ -702,7 +712,7 @@ char *pp; else goto ret; } } - if(fp->bflg[j]) + if(tabchar==0&&fp->bflg[j]) while(blank(*p)) p++; i = fp->n[j];