Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: tools/sort-headers.py

Issue 7050020: Teach sort-headers.py about windows.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sort-headers.py
diff --git a/tools/sort-headers.py b/tools/sort-headers.py
index b18ac6c4a83147e85a1051df45fa7f8e4206ac6e..c7c60ec6fb36a2adfc1dd7dad3cdbc75f55319b4 100755
--- a/tools/sort-headers.py
+++ b/tools/sort-headers.py
@@ -34,7 +34,12 @@ def IncludeCompareKey(line):
"""
for prefix in ('#include ', '#import '):
if line.startswith(prefix):
- return line[len(prefix):]
+ line = line[len(prefix):]
+ break
+ # <windows.h> needs to be before other includes, so return a key
+ # that's less than all other keys.
+ if line.find('<windows.h>') != -1:
Evan Martin 2011/05/19 20:04:33 Maybe test .startswith() instead? (will catch the
Nico 2011/05/19 20:06:21 Done. (lstrip().startswith() if someone accidental
+ return ''
return line
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698