commit | d5c4932cec8d114b1f99ec6978b43a8c618f9c62 | [log] [tgz] |
---|---|---|
author | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Thu May 19 20:08:57 2011 |
committer | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Thu May 19 20:08:57 2011 |
tree | 66a611bd5e33e5e75c474c7ce1f33714c7ceda2a | |
parent | c419a1a75fcc61f29c6cf6f333c2262c5de7fad0 [diff] [blame] |
Teach sort-headers.py about windows.h. See http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/a3480ba1e7b8b9c0# BUG=none TEST=Run sort-headers.py on a file that includes <windows.h>, e.g. base/file_util_unittest.cc. That line should stay at the top of its block. Review URL: http://codereview.chromium.org/7050020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85957 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tools/sort-headers.py b/tools/sort-headers.py index b18ac6c..d7633e8 100755 --- a/tools/sort-headers.py +++ b/tools/sort-headers.py
@@ -34,7 +34,12 @@ """ 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.lstrip().startswith('<windows.h>'): + return '' return line