Mercurial > hg > octave-lyh
diff src/error.cc @ 436:f7314b67a142
[project @ 1994-05-26 00:44:37 by jwe]
i
author | jwe |
---|---|
date | Thu, 26 May 1994 00:44:37 +0000 |
parents | a99f28f5e351 |
children | 6c445aacf230 |
line wrap: on
line diff
--- a/src/error.cc +++ b/src/error.cc @@ -1,7 +1,7 @@ // error.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -76,6 +76,9 @@ void error (const char *fmt, ...) { + if (error_state == -2) + return; + if (! error_state) error_state = 1; @@ -83,7 +86,18 @@ va_list args; va_start (args, fmt); - verror ("error", fmt, args); + + int len; + if (fmt && fmt[(len = strlen (fmt) - 1)] == '\n') + { + error_state = -2; + char *tmp_fmt = strsave (fmt); + tmp_fmt[len - 1] = '\0'; + verror ("error", tmp_fmt, args); + } + else + verror ("error", fmt, args); + va_end (args); }