Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 9861b1b5a68b75961c78a2cebfcd5f655d46220a..a883c4cd3ef3abe206efe0c2e29945e87480db62 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -1767,8 +1767,16 @@ static void AddIsolateIdIfNeeded(std::ostream& os, // NOLINT |
static void PrepareLogFileName(std::ostream& os, // NOLINT |
Isolate* isolate, const char* file_name) { |
- AddIsolateIdIfNeeded(os, isolate); |
+ int dir_separator_count = 0; |
for (const char* p = file_name; *p; p++) { |
+ if (base::OS::isDirectorySeparator(*p)) dir_separator_count++; |
+ } |
+ |
+ for (const char* p = file_name; *p; p++) { |
+ if (dir_separator_count == 0) { |
+ AddIsolateIdIfNeeded(os, isolate); |
+ dir_separator_count--; |
+ } |
if (*p == '%') { |
p++; |
switch (*p) { |
@@ -1794,6 +1802,7 @@ static void PrepareLogFileName(std::ostream& os, // NOLINT |
break; |
} |
} else { |
+ if (base::OS::isDirectorySeparator(*p)) dir_separator_count--; |
os << *p; |
} |
} |