From archie@whistle.com  Tue May 21 16:02:12 1996
Received: from whistle.com ([207.76.205.131])
          by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA08024
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 May 1996 16:02:12 -0700 (PDT)
Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id QAA00854 for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 May 1996 16:01:41 -0700 (PDT)
Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3)
	id sma000852; Tue May 21 16:01:39 1996
Received: (from archie@localhost) by bubba.whistle.com (8.6.12/8.6.12) id QAA20561; Tue, 21 May 1996 16:01:38 -0700
Message-Id: <199605212301.QAA20561@bubba.whistle.com>
Date: Tue, 21 May 1996 16:01:38 -0700
From: Archie Cobbs <archie@whistle.com>
Reply-To: archie@whistle.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: make ``.for'' loops iterate backwards
X-Send-Pr-Version: 3.2

>Number:         1230
>Category:       bin
>Synopsis:       make ``.for'' loops iterate backwards
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    steve
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 21 16:10:01 PDT 1996
>Closed-Date:    Fri Sep 20 21:35:35 PDT 1996
>Last-Modified:  Fri Sep 20 21:37:34 PDT 1996
>Originator:     Archie Cobbs
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
Whistle Communications, Inc.
>Environment:

	FreeBSD-2.1R, 2.2-current, ??

>Description:

	The make(1) construct ``.for VAR in ${ARGS}'' iterates
	from the last field in ${ARGS} to the first, instead of
	the other way around (as specified in the man page).

>How-To-Repeat:

	Create the following makefile and run make:

		ORIG=	a b c

		.for VAR in ${ORIG}
		LIST+=	${VAR}
		.endfor

		default:
			@echo ${LIST}

>Fix:

	Unknown

>Release-Note:
>Audit-Trail:

From: Steve Price <sprice@hiwaay.net>
To: archie@whistle.com
Cc: hackers@freebsd.org, FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1230: make ``.for'' loops iterate backwards
	
Date: Sun, 15 Sep 1996 17:18:40 -0500

 Attached is patch that fixes the problem pointed out in
 bin/1230.
 
 steve[~]$ cat Makefile
 ORIG= a b c
 
 .for VAR in a b c
 LIST+=  ${VAR}
 .endfor
 
 default:
         @echo ${LIST}
 ^D
 steve[~]$ make
 a b c
 steve[~]$ 
 
 
 Regards,
 
 Steve
 
 
 Index: for.c
 ===================================================================
 RCS file: /u/FreeBSD/cvs/src/usr.bin/make/for.c,v
 retrieving revision 1.3
 diff -u -r1.3 for.c
 --- for.c	1995/05/30 06:31:52	1.3
 +++ for.c	1996/09/14 00:26:03
 @@ -174,7 +174,7 @@
  #define ADDWORD() \
  	Buf_AddBytes(buf, ptr - wrd, (Byte *) wrd), \
  	Buf_AddByte(buf, (Byte) '\0'), \
 -	Lst_AtEnd(forLst, (ClientData) Buf_GetAll(buf, &varlen)), \
 +	Lst_AtFront(forLst, (ClientData) Buf_GetAll(buf, &varlen)), \
  	Buf_Destroy(buf, FALSE)
  
  	for (ptr = sub; *ptr && isspace((unsigned char) *ptr); ptr++)
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Fri Sep 20 21:35:35 PDT 1996 
State-Changed-Why:  
Fixed in revision 1.4 of for.c. 
>Unformatted:
