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

Unified Diff: src/log.cc

Issue 12861: Regexp logging and stl (Closed)
Patch Set: Created 12 years, 1 month 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/jsregexp.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 803dfe84df97a4a5e5cc42a204da6240f42e7f1f..d145480f07ae3264df7a7ec1328f63058bcb9275 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -356,12 +356,14 @@ void Logger::LogString(Handle<String> str) {
len = 256;
for (int i = 0; i < len; i++) {
uc32 c = str->Get(shape, i);
- if (c < 32 || (c > 126 && c <= 255)) {
- fprintf(logfile_, "\\x%02x", c);
- } else if (c > 255) {
+ if (c > 0xff) {
fprintf(logfile_, "\\u%04x", c);
+ } else if (c < 32 || c > 126) {
+ fprintf(logfile_, "\\x%02x", c);
} else if (c == ',') {
fprintf(logfile_, "\\,");
+ } else if (c == '\\') {
+ fprintf(logfile_, "\\\\");
} else {
fprintf(logfile_, "%lc", c);
}
« no previous file with comments | « src/jsregexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698