Added option for temporary directory
authorceriel <none@none>
Thu, 16 Jun 1988 09:57:59 +0000 (09:57 +0000)
committerceriel <none@none>
Thu, 16 Jun 1988 09:57:59 +0000 (09:57 +0000)
mach/proto/as/comm4.c
mach/proto/as/comm7.c

index 801fa07..802f694 100644 (file)
@@ -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;
index bc110d3..774b022 100644 (file)
@@ -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)));
 }