(distclean): Remove .deps.
[gnulib.git] / lib / error.c
index b1bbf18..2508ea8 100644 (file)
@@ -1,5 +1,5 @@
 /* error.c -- error handler for noninteractive utilities
-   Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -43,6 +43,9 @@
 void exit ();
 #endif
 
+/* This variable is incremented each time `error' is called.  */
+unsigned int error_message_count;
+
 /* If NULL, error will flush stdout, then print on stderr the program
    name, a colon and a space.  Otherwise, error will call this
    function without parameters instead.  */
@@ -53,7 +56,7 @@ void (*error_print_progname) () = NULL;
 extern char *program_name;
 
 #if HAVE_STRERROR
-# ifndef strerror              /* On some systems, sterror is a macro */
+# ifndef strerror              /* On some systems, strerror is a macro */
 char *strerror ();
 # endif
 #else
@@ -112,6 +115,8 @@ error (status, errnum, message, va_alist)
   fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
 #endif
 
+  ++error_message_count;
+
   if (errnum)
     fprintf (stderr, ": %s", strerror (errnum));
   putc ('\n', stderr);