From: ceriel Date: Thu, 16 Jun 1988 09:57:59 +0000 (+0000) Subject: Added option for temporary directory X-Git-Tag: release-5-5~3195 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8f1cac51c886e090f41fa24d5bcb4c53b932288c;p=ack.git Added option for temporary directory --- diff --git a/mach/proto/as/comm4.c b/mach/proto/as/comm4.c index 801fa0787..802f69462 100644 --- a/mach/proto/as/comm4.c +++ b/mach/proto/as/comm4.c @@ -67,6 +67,13 @@ char **argv; fatal("-o needs filename"); aoutpath = argv[i]; break; + case 'T': + if (*p != NULL) { + extern char *tmp_dir; + + tmp_dir = p; + } + break; case 'd': #ifdef LISTING dflag = 0; diff --git a/mach/proto/as/comm7.c b/mach/proto/as/comm7.c index bc110d3b5..774b022cd 100644 --- a/mach/proto/as/comm7.c +++ b/mach/proto/as/comm7.c @@ -159,8 +159,10 @@ listline(textline) putchar(c); } while ((c = getc(listfile)) != '\n'); } - if (listflag & 7) + if (listflag & 7) { putchar('\n'); + fflush(stdout); + } listeoln = 1; listcolm = 0; listflag = listtemp; @@ -314,6 +316,11 @@ char *s; return(f); } +#ifndef TMPDIR +#define TMPDIR "/tmp" +#endif +char *tmp_dir = TMPDIR; + FILE * fftemp(path, tail) char *path, *tail; @@ -321,11 +328,7 @@ char *path, *tail; register char *dir; if ((dir = getenv("TMPDIR")) == NULL) -#ifdef TMPDIR - dir = TMPDIR; -#else - dir = "/tmp"; -#endif + dir = tmp_dir; sprintf(path, "%s/%s", dir, tail); return(ffcreat(mktemp(path))); }