Clarify that assignment is for effect, not truth of value.

CID 977502
This commit is contained in:
riastradh 2017-04-16 21:04:44 +00:00
parent 0b16a13b06
commit eeadb7df8c

View File

@ -1,4 +1,4 @@
/* $NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $ */
/* $NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $ */
/*
* Copyright (c) 1992, The Regents of the University of California.
@ -30,14 +30,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $";
static char rcsid[] = "$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $");
__RCSID("$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $");
#endif
#endif /* not lint */
#endif
@ -427,7 +427,7 @@ For_Iterate(void *v_arg, size_t *ret_len)
for (cp = cmd_cp; (cp = strchr(cp, '$')) != NULL;) {
char ech;
ch = *++cp;
if ((ch == '(' && (ech = ')')) || (ch == '{' && (ech = '}'))) {
if ((ch == '(' && (ech = ')', 1)) || (ch == '{' && (ech = '}', 1))) {
cp++;
/* Check variable name against the .for loop variables */
STRLIST_FOREACH(var, &arg->vars, i) {