From 6fc385b5ff3427db3c5d0931dcb36ed4497db9dc Mon Sep 17 00:00:00 2001 From: John Woods Date: Tue, 17 Mar 1992 00:00:00 +0000 Subject: [PATCH] MAKE HUNG ON SINGLE "-" ARGUMENT [ This is a patch rolled in from work done on 4.3Reno/NET2 ] There is a bug in the new make from 4.3Reno and also present in the Net2 release (as found on uunet). A command line argument consisting of a lone dash (-) causes an infinite loop ("make - make" was an excellent test case). AUTHOR: John Woods (jfw@eddie.mit.edu) 386BSD-Patchkit: patch00015 --- usr/src/usr.bin/make/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usr/src/usr.bin/make/main.c b/usr/src/usr.bin/make/main.c index 0c74944aeb..959e7b6eea 100644 --- a/usr/src/usr.bin/make/main.c +++ b/usr/src/usr.bin/make/main.c @@ -34,6 +34,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE + * -------------------- ----- ---------------------- + * CURRENT PATCH LEVEL: 1 00015 + * -------------------- ----- ---------------------- + * + * 17 Mar 92 John Woods Fix "make - make" bug */ #ifndef lint @@ -280,7 +287,10 @@ rearg: while((c = getopt(argc, argv, "D:I:d:ef:ij:knqrst")) != EOF) { if (!**argv) Punt("illegal (null) argument."); if (**argv == '-') { - optind = 0; +/* 17 Mar 92*/ if ((*argv)[1]) +/* 17 Mar 92*/ optind = 0; /* -flag... */ +/* 17 Mar 92*/ else +/* 17 Mar 92*/ optind = 1; /* - */ goto rearg; } (void)Lst_AtEnd(create, (ClientData)*argv); -- 2.20.1