summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/targ.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-12-08 16:22:01 +0000
committerharti <harti@FreeBSD.org>2004-12-08 16:22:01 +0000
commitbcb1f1f6f57e4630d36245b7c5fb2ce234218041 (patch)
tree033640eae93833ae9810ed9247ac98509312f27b /usr.bin/make/targ.c
parenta3e11dfa9b1fa344ae2ae1129eaf1c441f32d88e (diff)
downloadFreeBSD-src-bcb1f1f6f57e4630d36245b7c5fb2ce234218041.zip
FreeBSD-src-bcb1f1f6f57e4630d36245b7c5fb2ce234218041.tar.gz
Get rid of the sequential access feature of the lists. This was used
only in a couple of places and all of them except for one were easily converted to use Lst_First/Lst_Succ. The one place is compatibility mode in job.c where the it was used to advance to the next command on each invocation of JobStart. For this case add a pointer to the node to hold the currently executed command.
Diffstat (limited to 'usr.bin/make/targ.c')
-rw-r--r--usr.bin/make/targ.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c
index b10180d..5a93d7f 100644
--- a/usr.bin/make/targ.c
+++ b/usr.bin/make/targ.c
@@ -286,10 +286,7 @@ Targ_FindList(Lst *names, int flags)
nodes = Lst_Init();
- if (Lst_Open(names) == FAILURE) {
- return (nodes);
- }
- while ((ln = Lst_Next(names)) != NULL) {
+ for (ln = Lst_First(names); ln != NULL; ln = Lst_Succ(ln)) {
name = Lst_Datum(ln);
gn = Targ_FindNode(name, flags);
if (gn != NULL) {
@@ -306,7 +303,6 @@ Targ_FindList(Lst *names, int flags)
Error("\"%s\" -- target unknown.", name);
}
}
- Lst_Close(names);
return (nodes);
}
OpenPOWER on IntegriCloud