From: Qingning Huo Date: Fri, 10 Jun 2011 23:13:33 +0000 (+0100) Subject: src/graph.cc: fix EdgeEnv::LookupVariable X-Git-Tag: release-120715~333^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edc4062f6b6f3984b737a5e2ae1ed6b9d50b4905;p=platform%2Fupstream%2Fninja.git src/graph.cc: fix EdgeEnv::LookupVariable Make it return the correct value for "out" when there are multiple outputs. It used to return only the first target file. --- diff --git a/src/graph.cc b/src/graph.cc index 8abaa2a..13927fe 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -105,7 +105,12 @@ struct EdgeEnv : public Env { result.append((*i)->file_->path_); } } else if (var == "out") { - result = edge_->outputs_[0]->file_->path_; + for (vector::iterator i = edge_->outputs_.begin(); + i != edge_->outputs_.end(); ++i) { + if (!result.empty()) + result.push_back(' '); + result.append((*i)->file_->path_); + } } else if (edge_->env_) { return edge_->env_->LookupVariable(var); }