Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: src/log.cc

Issue 960813004: Fix preparing log file name. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « src/base/platform/platform-win32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698