summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-08 05:29:37 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-08 05:29:37 +0000
commitaf328b152b68bb21549e52df230b17a8672795c3 (patch)
tree8a63998435ddc0a3367124967bf063f01e7cfbb9 /error.c
parent41e41d34d14ef3595a54148368b89b6c75d0fe4d (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/error.c b/error.c
index 736598c..540e57d 100644
--- a/error.c
+++ b/error.c
@@ -100,6 +100,19 @@ rb_compile_error_append(fmt, va_alist)
err_append(buf);
}
+static void
+warn_print(fmt, args)
+ const char *fmt;
+ va_list args;
+{
+ char buf[BUFSIZ];
+
+ err_snprintf(buf, BUFSIZ, fmt, args);
+ fputs(buf, stderr);
+ fputs("\n", stderr);
+ fflush(stderr);
+}
+
void
#ifdef HAVE_STDARG_PROTOTYPES
rb_warn(const char *fmt, ...)
@@ -115,7 +128,7 @@ rb_warn(fmt, va_alist)
snprintf(buf, BUFSIZ, "warning: %s", fmt);
va_init_list(args, fmt);
- err_print(buf, args);
+ warn_print(buf, args);
va_end(args);
}
@@ -137,7 +150,7 @@ rb_warning(fmt, va_alist)
snprintf(buf, BUFSIZ, "warning: %s", fmt);
va_init_list(args, fmt);
- err_print(buf, args);
+ warn_print(buf, args);
va_end(args);
}
@@ -157,7 +170,7 @@ rb_bug(fmt, va_alist)
ruby_in_eval = 0;
va_init_list(args, fmt);
- err_print(buf, args);
+ warn_print(buf, args);
va_end(args);
ruby_show_version();
abort();