From jwd@unx.sas.com  Fri Jan  8 10:17:49 1999
Received: from lamb.sas.com (lamb.sas.com [192.35.83.8])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA01120
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 8 Jan 1999 10:17:48 -0800 (PST)
          (envelope-from jwd@unx.sas.com)
Received: from mozart (mozart.unx.sas.com [192.58.184.8])
	by lamb.sas.com (8.9.1/8.9.1) with SMTP id NAA14341
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 8 Jan 1999 13:17:17 -0500 (EST)
Received: from freebsd.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90)
	id AA09395; Fri, 8 Jan 1999 13:17:16 -0500
Received: (from jwd@localhost)
	by freebsd.unx.sas.com (8.9.1/8.9.1) id NAA00528;
	Fri, 8 Jan 1999 13:07:43 -0500 (EST)
	(envelope-from jwd)
Message-Id: <199901081807.NAA00528@freebsd.unx.sas.com>
Date: Fri, 8 Jan 1999 13:07:43 -0500 (EST)
From: jwd@unx.sas.com
Reply-To: jwd@unx.sas.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: make(1) /usr/src/usr.bin/make/parse.c strncmp(opc,":sh') is bad
X-Send-Pr-Version: 3.2

>Number:         9393
>Category:       bin
>Synopsis:       /usr/src/usr.bin/make/parse.c strncmp(opc,":sh') is bad
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan  8 10:20:00 PST 1999
>Closed-Date:    Sun Jan 10 10:07:07 PST 1999
>Last-Modified:  Sun Jan 10 10:07:39 PST 1999
>Originator:     John DeBoskey
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
SAS Institute
>Environment:

FreeBSD FreeBSD.pc.sas.com 3.0-CURRENT FreeBSD 3.0-CURRENT #0
-current machine with sources current as of 19990108.
       
>Description:

The variable opc is decremented 1 time too many. If the character
pointed to by opc happens to be a ':' and the variable name
being assigned to starts with "sh", then the assignment type
is erroniously set to VAR_SHELL.

>How-To-Repeat:

I seem to be the only one having this problem. It only happens
during a 'cd /usr/src/release && make release' when building the
dynamically created make file 'boot_crunch.mk' (inside the release.4
target).

>Fix:

   After determining that 'opc' is nolonger within the bounds of 
the variable 'line', increment it by 1 to bring it back to the
start of 'line', instead of allowing it to point at a garbage
character that might just happen to be a ':'.
	
--- /usr/src/usr.bin/make/parse.c.orig  Sun May 31 02:23:33 1998
+++ /usr/src/usr.bin/make/parse.c       Fri Jan  8 03:05:23 1999
@@ -1412,8 +1412,10 @@
        default:
 #ifdef SUNSHCMD
            while (*opc != ':')
-               if (--opc < line)
+               if (--opc < line) {
+                   ++opc;
                    break;
+               }
 
            if (strncmp(opc, ":sh", 3) == 0) {
                type = VAR_SHELL;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Jan 10 10:07:07 PST 1999 
State-Changed-Why:  
Fixed by Jordan in rev.1.20 of src/usr.bin/make/parse.c. 
>Unformatted:
