diff options
| author | rillig <rillig@NetBSD.org> | 2020-09-06 19:19:49 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2020-09-06 19:19:49 +0000 |
| commit | 56bba2a06c047a00a40aa19d23041b56e8f87f3b (patch) | |
| tree | 19d945161cf95e9584bee40f2ec36fa8a1f60278 /usr.bin/make/for.c | |
| parent | 69514deec992cd3ac58ecb9991924e0dda826ae9 (diff) | |
make(1): improve documentation in For_Eval
Diffstat (limited to 'usr.bin/make/for.c')
| -rw-r--r-- | usr.bin/make/for.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index ef5bfb86bfc..1b07651b959 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -1,4 +1,4 @@ -/* $NetBSD: for.c,v 1.69 2020/09/06 19:18:16 rillig Exp $ */ +/* $NetBSD: for.c,v 1.70 2020/09/06 19:19:49 rillig 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.69 2020/09/06 19:18:16 rillig Exp $"; +static char rcsid[] = "$NetBSD: for.c,v 1.70 2020/09/06 19:19:49 rillig 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.69 2020/09/06 19:18:16 rillig Exp $"); +__RCSID("$NetBSD: for.c,v 1.70 2020/09/06 19:19:49 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -108,12 +108,8 @@ For_Free(For *arg) free(arg); } -/*- - *----------------------------------------------------------------------- - * For_Eval -- - * Evaluate the for loop in the passed line. The line - * looks like this: - * .for <variable> in <varlist> +/* Evaluate the for loop in the passed line. The line looks like this: + * .for <varname...> in <value...> * * Input: * line Line to parse @@ -122,11 +118,6 @@ For_Free(For *arg) * 0: Not a .for statement, parse the line * 1: We found a for loop * -1: A .for statement with a bad syntax error, discard. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- */ int For_Eval(char *line) @@ -194,12 +185,12 @@ For_Eval(char *line) ptr++; /* - * Make a list with the remaining words - * The values are substituted as ${:U<value>...} so we must \ escape - * characters that break that syntax. + * Make a list with the remaining words. + * The values are later substituted as ${:U<value>...} so we must + * backslash-escape characters that break that syntax. * Variables are fully expanded - so it is safe for escape $. * We can't do the escapes here - because we don't know whether - * we are substuting into ${...} or $(...). + * we will be substituting into ${...} or $(...). */ sub = Var_Subst(ptr, VAR_GLOBAL, VARE_WANTRES); |
