[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:
Sergey Matveev 2013-07-22 16:14:38 +00:00
parent e0b2c8e478
commit 540338259d
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}