diff options
author | Evan Martin <martine@danga.com> | 2012-09-13 22:33:40 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-09-13 22:33:40 (GMT) |
commit | 7096bf1507f98be981aa14ffd9ed5a4a8b1c1494 (patch) | |
tree | 10f75334ddb1dc86c2cc85db0cab93ca672d39de /misc/ninja_syntax.py | |
parent | 50af448b293b411bde5232931525574aba3bb451 (diff) | |
parent | 06fa62352d1e9868409b299ffc8abc8f4cd9a39d (diff) | |
download | Ninja-1.0.0.zip Ninja-1.0.0.tar.gz Ninja-1.0.0.tar.bz2 |
version 1.0.0v1.0.0
Diffstat (limited to 'misc/ninja_syntax.py')
-rw-r--r-- | misc/ninja_syntax.py | 12 |
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) |