trunk: changeset 56

Wed, 16 Apr 2003 09:09:34 +0200

author
tuomov
date
Wed, 16 Apr 2003 09:09:34 +0200
changeset 52
0228b3741a42
parent 51
2d95d77aa954
child 53
f8f9366b359c

trunk: changeset 56
set_warn_handler returns default_warn_handler instead of NULL when no
other warn handlers are set.

output.c file | annotate | diff | comparison | revisions
--- a/output.c	Sat Apr 05 22:32:55 2003 +0200
+++ b/output.c	Wed Apr 16 09:09:34 2003 +0200
@@ -20,13 +20,13 @@
 #endif
 
 
-/* verbose
- */
+static void default_warn_handler(const char *message);
+
 
 static bool verbose_mode=FALSE;
 static int verbose_indent_lvl=0;
 static bool progname_enable=TRUE;
-static WarnHandler *current_warn_handler=NULL;
+static WarnHandler *current_warn_handler=default_warn_handler;
 
 #define INDENTATOR_LENGTH 4
 
@@ -387,6 +387,6 @@
 WarnHandler *set_warn_handler(WarnHandler *handler)
 {
 	WarnHandler *old=current_warn_handler;
-	current_warn_handler=handler;
+	current_warn_handler=(handler!=NULL ? handler : default_warn_handler);
 	return old;
 }

mercurial