date and time created 83/03/09 16:22:07 by ralph
[unix-history] / usr / src / old / make / main.c
index 24adec5..fa61838 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)main.c      4.3 (Berkeley) 82/10/10";
+static char *sccsid = "@(#)main.c      4.5 (Berkeley) 83/03/03";
 # include "defs"
 /*
 command make to update programs.
 # include "defs"
 /*
 command make to update programs.
@@ -153,6 +153,8 @@ for (i=1; i<argc; ++i)
        }
 
 *op++ = '\0';
        }
 
 *op++ = '\0';
+if (strcmp(options, "-") == 0)
+       *options = '\0';
 setvar("MFLAGS", options);             /* MFLAGS=options to make */
 
 if( !descset )
 setvar("MFLAGS", options);             /* MFLAGS=options to make */
 
 if( !descset )
@@ -206,7 +208,7 @@ if(nfargs == 0)
 exit(0);
 }
 
 exit(0);
 }
 
-
+#include <sys/stat.h>
 
 #ifdef unix
 intrupt()
 
 #ifdef unix
 intrupt()
@@ -214,9 +216,12 @@ intrupt()
 struct varblock *varptr();
 char *p;
 TIMETYPE exists();
 struct varblock *varptr();
 char *p;
 TIMETYPE exists();
+struct stat sbuf;
 
 if(okdel && !noexflag && !touchflag &&
 
 if(okdel && !noexflag && !touchflag &&
-       (p = varptr("@")->varval) && exists(p)>0 && !isprecious(p) )
+       (p = varptr("@")->varval) &&
+       (stat(p, &sbuf) >= 0 && (sbuf.st_mode&S_IFMT) == S_IFREG) &&
+       !isprecious(p) )
                {
                fprintf(stderr, "\n***  %s removed.", p);
                unlink(p);
                {
                fprintf(stderr, "\n***  %s removed.", p);
                unlink(p);