summaryrefslogtreecommitdiffstats
path: root/misc/ninja_syntax.py
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-05-02 01:26:51 (GMT)
committerNico Weber <nicolasweber@gmx.de>2012-05-02 01:26:51 (GMT)
commit7ef52b4c6f3a5f2e57a54c045027516e045b5d67 (patch)
tree13ce044f8e30bbec423a2621c02c5b623cec3ce5 /misc/ninja_syntax.py
parent4d1674f37a0a3aeaa8be6bcce66555871cba8995 (diff)
downloadNinja-7ef52b4c6f3a5f2e57a54c045027516e045b5d67.zip
Ninja-7ef52b4c6f3a5f2e57a54c045027516e045b5d67.tar.gz
Ninja-7ef52b4c6f3a5f2e57a54c045027516e045b5d67.tar.bz2
Fix layout width in ninja_syntax.py.
The last line would sometimes be needlessly longer than the layout width. One example is line 67 in the build.ninja generated by ninja's own configure.py: Before this patch, ninja_syntax would create a 81 character line.
Diffstat (limited to 'misc/ninja_syntax.py')
-rw-r--r--misc/ninja_syntax.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/ninja_syntax.py b/misc/ninja_syntax.py
index 97bd82b..3ecbcee 100644
--- a/misc/ninja_syntax.py
+++ b/misc/ninja_syntax.py
@@ -101,7 +101,7 @@ class Writer(object):
def _line(self, text, indent=0):
"""Write 'text' word-wrapped at self.width characters."""
leading_space = ' ' * indent
- while len(text) > self.width:
+ while len(leading_space) + len(text) > self.width:
# The text is too wide; wrap if possible.
# Find the rightmost space that would obey our width constraint and