From: Jeremy Apthorp Date: Mon, 28 Nov 2011 02:54:35 +0000 (+1100) Subject: When expanding $in and $out, wrap with quotes if the filename has a space. X-Git-Tag: release-120715~155^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c46f3cbd7f9706437392dcfa9df27341aadb1b37;p=platform%2Fupstream%2Fninja.git When expanding $in and $out, wrap with quotes if the filename has a space. --- diff --git a/src/graph.cc b/src/graph.cc index 9f7fc76..ed7097b 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -189,7 +189,14 @@ string EdgeEnv::MakePathList(vector::iterator begin, for (vector::iterator i = begin; i != end; ++i) { if (!result.empty()) result.push_back(' '); - result.append((*i)->path()); + const string& path = (*i)->path(); + if (path.find(" ") != string::npos) { + result.append("\""); + result.append(path); + result.append("\""); + } else { + result.append(path); + } } return result; }