summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-19 09:15:27 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-19 09:15:27 +0000
commit86833594ff917d578aa24a4536995fa6573300a6 (patch)
treef1abc7feb58a2faaaa14621ef75c32f114f1d193 /error.c
parentec6e3f9ec351d2e39d8113101605361664cf7494 (diff)
* string.c (rb_str_substr): "a"[1,2] should return ""; need
rubicon upgrade. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/error.c b/error.c
index 03bc93f..7411e95 100644
--- a/error.c
+++ b/error.c
@@ -702,6 +702,32 @@ rb_sys_fail(mesg)
}
void
+#ifdef HAVE_STDARG_PROTOTYPES
+rb_sys_warning(const char *fmt, ...)
+#else
+rb_sys_warning(fmt, va_alist)
+ const char *fmt;
+ va_dcl
+#endif
+{
+ char buf[BUFSIZ];
+ va_list args;
+ int errno_save;
+
+ errno_save = errno;
+
+ if (!RTEST(ruby_verbose)) return;
+
+ snprintf(buf, BUFSIZ, "warning: %s", fmt);
+ snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save));
+
+ va_init_list(args, fmt);
+ warn_print(buf, args);
+ va_end(args);
+ errno = errno_save;
+}
+
+void
rb_load_fail(path)
char *path;
{