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):
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):
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits