ruby-changes:38394
From: nobu <ko1@a...>
Date: Tue, 12 May 2015 16:23:14 +0900 (JST)
Subject: [ruby-changes:38394] nobu:r50475 (trunk): vm_dump.c: statement for crash report log
nobu 2015-05-12 16:22:57 +0900 (Tue, 12 May 2015) New Revision: 50475 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50475 Log: vm_dump.c: statement for crash report log * vm_dump.c (preface_dump): move the statement to include crash report log file from REPORTBUG_MSG in error.c. Modified files: trunk/error.c trunk/vm_dump.c Index: error.c =================================================================== --- error.c (revision 50474) +++ error.c (revision 50475) @@ -47,9 +47,6 @@ static const char REPORTBUG_MSG[] = https://github.com/ruby/ruby/blob/trunk/error.c#L47 " or extension libraries.\n" \ "Bug reports are welcome.\n" \ "" -#if defined __APPLE__ - "Don't forget to include the above Crash Report log file.\n" -#endif "For details: http://www.ruby-lang.org/bugreport.html\n\n" \ ; Index: vm_dump.c =================================================================== --- vm_dump.c (revision 50474) +++ vm_dump.c (revision 50475) @@ -949,6 +949,7 @@ preface_dump(void) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L949 " * ~/Library/Logs/DiagnosticReports\n" " * /Library/Logs/DiagnosticReports\n" " for more details.\n" + "Don't forget to include the above Crash Report log file in bug reports.\n" "\n"; const char *const endmsg = msg + sizeof(msg) - 1; const char *p = msg; @@ -959,18 +960,14 @@ preface_dump(void) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L960 if (isatty(fileno(stderr))) { const char *e = strchr(p, '\n'); const int w = (int)(e - p); - fputs(RED, stderr); - fwrite(p, 1, w, stderr); - fputs(RESET, stderr); - fputc('\n', stderr); - while ((p = e + 1) < endmsg && (e = strchr(p, '\n')) != 0 && e > p + 1) { + do { int i = (int)(e - p); - fputs(GREEN, stderr); + fputs(*p == ' ' ? GREEN : RED, stderr); fwrite(p, 1, e - p, stderr); for (; i < w; ++i) fputc(' ', stderr); fputs(RESET, stderr); fputc('\n', stderr); - } + } while ((p = e + 1) < endmsg && (e = strchr(p, '\n')) != 0 && e > p + 1); } fwrite(p, 1, endmsg - p, stderr); #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/