Get the part of filepath after the last path separator. (Doesn't modify filepath, contrary to basename() in libgen.h.) Borrowed from glog.
| 78 | // (Doesn't modify filepath, contrary to basename() in libgen.h.) |
| 79 | // Borrowed from glog. |
| 80 | static const char* const_basename(const char* filepath) { |
| 81 | const char* base = strrchr(filepath, '/'); |
| 82 | #ifdef OS_WINDOWS // Look for either path separator in Windows |
| 83 | if (!base) |
| 84 | base = strrchr(filepath, '\\'); |
| 85 | #endif |
| 86 | return base ? (base+1) : filepath; |
| 87 | } |
| 88 | |
| 89 | |
| 90 | void Trace::SubstituteAndTrace(const char* file_path, |