forked from OSchip/llvm-project
[sanitizer] Change strip_path_prefix flag behavior.
Previously (in tools other than TSan) the entire prefix of the path had to mach the argument. With this change, only some suffix of the prefix has to match. This is the same way this flag works in TSan. llvm-svn: 186837
This commit is contained in:
parent
e0b2c8e478
commit
540338259d
|
@ -20,8 +20,9 @@ namespace __sanitizer {
|
|||
const char *StripPathPrefix(const char *filepath,
|
||||
const char *strip_file_prefix) {
|
||||
if (filepath == 0) return 0;
|
||||
if (filepath == internal_strstr(filepath, strip_file_prefix))
|
||||
return filepath + internal_strlen(strip_file_prefix);
|
||||
const char *prefix_beg = internal_strstr(filepath, strip_file_prefix);
|
||||
if (prefix_beg)
|
||||
return prefix_beg + internal_strlen(strip_file_prefix);
|
||||
return filepath;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue