aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/algorithm.cxx')
-rw-r--r--libbuild2/algorithm.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index e1f30e0..75540ff 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -2390,8 +2390,16 @@ namespace build2
group_view gv (g.group_members (a));
if (gv.count != 0)
{
- ep = gv.members[0]->as<file> ().path () + ".d";
+ for (size_t i (0); i != gv.count; ++i)
+ {
+ if (const target* m = gv.members[i])
+ {
+ ep = m->as<file> ().path () + ".d";
+ break;
+ }
+ }
+ assert (!ep.empty ());
if (rmfile (ctx, ep, 3))
er = target_state::changed;
}