# HG changeset patch # User John W. Eaton # Date 1429978671 14400 # Node ID 0aed244dbdb33bb5f99250e7c88c46eee951051d # Parent 1784bf79ed432bfd114fe9b2fe9b34605ccfc906 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. diff -r 1784bf79ed43 -r 0aed244dbdb3 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Fri Apr 24 18:43:36 2015 +0200 +++ b/libinterp/corefcn/error.cc Sat Apr 25 12:17:51 2015 -0400 @@ -638,7 +638,12 @@ bool in_user_code = octave_call_stack::caller_user_code () != 0; - if (in_user_code && Vbacktrace_on_warning && ! warning_state + bool fmt_suppresses_backtrace = false; + size_t fmt_len = fmt ? strlen (fmt) : 0; + fmt_suppresses_backtrace = (fmt_len > 0 && fmt[fmt_len-1] == '\n'); + + if (! fmt_suppresses_backtrace && in_user_code + && Vbacktrace_on_warning && ! warning_state && ! discard_warning_messages) pr_where ("warning");