aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-28 08:48:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 15:47:28 +0200
commitb808c255b6a9ddba085bf5646e7d20ec344f2e2d (patch)
tree32730291f7e6de8ef0a227905520dd66fb4ec0f3 /libbuild2/cc/link-rule.cxx
parent3552356a87402727e663131994fa87f48b3cd4fb (diff)
Initial support for ad hoc recipes (still work in progress)
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r--libbuild2/cc/link-rule.cxx24
1 files changed, 5 insertions, 19 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index b11ee42..bc8eb8e 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -2145,22 +2145,8 @@ namespace build2
// 1 is resource ID, 24 is RT_MANIFEST. We also need to
// escape Windows path backslashes.
//
- os << "1 24 \"";
-
- const string& s (mf.string ());
- for (size_t i (0), j;; i = j + 1)
- {
- j = s.find ('\\', i);
- os.write (s.c_str () + i,
- (j == string::npos ? s.size () : j) - i);
-
- if (j == string::npos)
- break;
-
- os.write ("\\\\", 2);
- }
-
- os << "\"" << endl;
+ os << "1 24 \"" << sanitize_strlit (mf.string ()) << '"'
+ << endl;
os.close ();
rm.cancel ();
@@ -3035,14 +3021,14 @@ namespace build2
auto_rmfile trm;
string targ;
{
- // Calculate the would-be command line length similar to how process'
- // implementation does it.
- //
auto quote = [s = string ()] (const char* a) mutable -> const char*
{
return process::quote_argument (a, s);
};
+ // Calculate the would-be command line length similar to how process'
+ // implementation does it.
+ //
size_t n (0);
for (const char* a: args)
{