aboutsummaryrefslogtreecommitdiff
path: root/scripts/ninjatool.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ninjatool.py')
-rwxr-xr-xscripts/ninjatool.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py
index cc77d51aa8..ba6bd9a2a6 100755
--- a/scripts/ninjatool.py
+++ b/scripts/ninjatool.py
@@ -55,7 +55,7 @@ else:
PATH_RE = r"[^$\s:|]+|\$[$ :]|\$[a-zA-Z0-9_-]+|\$\{[a-zA-Z0-9_.-]+\}"
-SIMPLE_PATH_RE = re.compile(r"[^$\s:|]+")
+SIMPLE_PATH_RE = re.compile(r"^[^$\s:|]+$")
IDENT_RE = re.compile(r"[a-zA-Z0-9_.-]+$")
STRING_RE = re.compile(r"(" + PATH_RE + r"|[\s:|])(?:\r?\n)?|.")
TOPLEVEL_RE = re.compile(r"([=:#]|\|\|?|^ +|(?:" + PATH_RE + r")+)\s*|.")
@@ -834,7 +834,8 @@ class Ninja2Make(NinjaParserEventsWithVars):
self.print()
for targets in self.build_vars:
for name, value in self.build_vars[targets].items():
- self.print('%s: private .var.%s := %s' % (targets, name, value))
+ self.print('%s: private .var.%s := %s' %
+ (targets, name, value.replace('$', '$$')))
self.print()
if not self.seen_default:
default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key)