From 99d5c44319e239cd94f52b3d5d370f550d8c9ec2 Mon Sep 17 00:00:00 2001 From: Ken Greiner Date: Mon, 10 Jan 2022 12:18:31 -0500 Subject: [PATCH] EH-272 better resolution to parsing bug. --- review.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/review.py b/review.py index 464c2cb..9da0375 100755 --- a/review.py +++ b/review.py @@ -378,17 +378,14 @@ def main( # unless it's '.', in which case use all of directory if original_directory.endswith(args.build_dir): build_dir_index = -(len(args.build_dir) + 1) + basedir = original_directory[:build_dir_index] elif args.build_dir == ".": - if (original_directory.endswith("/")): - build_dir_index = -1 - else: - build_dir_index = len(original_directory) + 1 + basedir = original_directory else: raise RuntimeError( f"compile_commands.json contains absolute paths that I don't know how to deal with: '{original_directory}'" ) - basedir = original_directory[:build_dir_index] newbasedir = os.getcwd() print(f"Replacing '{basedir}' with '{newbasedir}'", flush=True)