[PATCH] D119481: run-clang-tidy: Fix infinite loop on windows
Fabian Keßler via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 26 06:29:17 PST 2022
Febbe updated this revision to Diff 411606.
Febbe added a comment.
Applied the feedback
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119481/new/
https://reviews.llvm.org/D119481
Files:
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Index: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -64,13 +64,14 @@
def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
- result = './'
+ result = os.path.realpath('./')
while not os.path.isfile(os.path.join(result, path)):
- if os.path.realpath(result) == '/':
+ parent = os.path.dirname(result)
+ if result == parent:
print('Error: could not find compilation database.')
sys.exit(1)
- result += '../'
- return os.path.realpath(result)
+ result = parent
+ return result
def make_absolute(f, directory):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119481.411606.patch
Type: text/x-patch
Size: 794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220226/7a8b028d/attachment.bin>
More information about the cfe-commits
mailing list