summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/ninja_syntax.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/ninja_syntax.py b/misc/ninja_syntax.py
index 3ecbcee..66babbe 100644
--- a/misc/ninja_syntax.py
+++ b/misc/ninja_syntax.py
@@ -10,8 +10,8 @@ use Python.
import textwrap
import re
-def escape_spaces(word):
- return word.replace('$ ','$$ ').replace(' ','$ ')
+def escape_path(word):
+ return word.replace('$ ','$$ ').replace(' ','$ ').replace(':', '$:')
class Writer(object):
def __init__(self, output, width=78):
@@ -53,15 +53,15 @@ class Writer(object):
variables=None):
outputs = self._as_list(outputs)
all_inputs = self._as_list(inputs)[:]
- out_outputs = list(map(escape_spaces, outputs))
- all_inputs = list(map(escape_spaces, all_inputs))
+ out_outputs = list(map(escape_path, outputs))
+ all_inputs = list(map(escape_path, all_inputs))
if implicit:
- implicit = map(escape_spaces, self._as_list(implicit))
+ implicit = map(escape_path, self._as_list(implicit))
all_inputs.append('|')
all_inputs.extend(implicit)
if order_only:
- order_only = map(escape_spaces, self._as_list(order_only))
+ order_only = map(escape_path, self._as_list(order_only))
all_inputs.append('||')
all_inputs.extend(order_only)