Mercurial > octave-antonio
comparison libinterp/corefcn/error.cc @ 20130:0aed244dbdb3
don't print stack trace if warning format ends with newline character
* error.cc (warning_1): Skip printing stack trace if format string
ends with newline character.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 25 Apr 2015 12:17:51 -0400 |
parents | a42de4173533 |
children | 64a2d4c87ecb |
comparison
equal
deleted
inserted
replaced
20129:1784bf79ed43 | 20130:0aed244dbdb3 |
---|---|
636 { | 636 { |
637 vwarning ("warning", id, fmt, args); | 637 vwarning ("warning", id, fmt, args); |
638 | 638 |
639 bool in_user_code = octave_call_stack::caller_user_code () != 0; | 639 bool in_user_code = octave_call_stack::caller_user_code () != 0; |
640 | 640 |
641 if (in_user_code && Vbacktrace_on_warning && ! warning_state | 641 bool fmt_suppresses_backtrace = false; |
642 size_t fmt_len = fmt ? strlen (fmt) : 0; | |
643 fmt_suppresses_backtrace = (fmt_len > 0 && fmt[fmt_len-1] == '\n'); | |
644 | |
645 if (! fmt_suppresses_backtrace && in_user_code | |
646 && Vbacktrace_on_warning && ! warning_state | |
642 && ! discard_warning_messages) | 647 && ! discard_warning_messages) |
643 pr_where ("warning"); | 648 pr_where ("warning"); |
644 | 649 |
645 warning_state = 1; | 650 warning_state = 1; |
646 | 651 |