HBehrens / puncover

Analyses C/C++ build output for code size, static variables, and stack usage
MIT License
431 stars 94 forks source link

Fix file path normalization #97

Open mroja opened 1 year ago

mroja commented 1 year ago

This PR fixes a bug where base_dir is ignored and all paths in the generated report are absolute.

In normalize_files_paths function base_dir is normalized as os.path.abspath(base_dir), but this function returns a string. Then base_dir in path.parents condition fails to detect that we are inside base directory, because it expects pathlib.Path not string.

This PR fixes problem by making base_dir always an instance of pathlib.Path.