X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/a68924a6e07d69bc4b8d6106b3af0ac5a7490905..31cef89cb428866f787983e68246030321893df4:/usr/src/cmd/sort.c?ds=inline diff --git a/usr/src/cmd/sort.c b/usr/src/cmd/sort.c index 8da6251eeb..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 @@ -259,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(); @@ -559,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) @@ -590,6 +594,12 @@ char *i, *j; lb = eol(pb); } if(fp->nflg) { + if(tabchar) { + if(pa0||j==0) + p++; } else { while(blank(*p)) p++; @@ -701,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];