changeset 436:f7314b67a142

[project @ 1994-05-26 00:44:37 by jwe] i
author jwe
date Thu, 26 May 1994 00:44:37 +0000
parents 5e778965b6ea
children 6c445aacf230
files src/error.cc
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/error.cc	Wed May 25 23:59:02 1994 +0000
+++ b/src/error.cc	Thu May 26 00:44:37 1994 +0000
@@ -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);
 }