1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* error.c (rb_bug): should not use other methods; this function is

not for ordinary use.  [ruby-dev:21259]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-08-27 13:33:27 +00:00
parent 0ec8683145
commit a5729ea05a
2 changed files with 21 additions and 12 deletions

View file

@ -1,3 +1,8 @@
Wed Aug 27 22:33:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (rb_bug): should not use other methods; this function is
not for ordinary use. [ruby-dev:21259]
Wed Aug 27 15:07:57 2003 Minero Aoki <aamine@loveruby.net> Wed Aug 27 15:07:57 2003 Minero Aoki <aamine@loveruby.net>
* lib/net/smtp.rb (check_response): AUTH CRAM-MD5 returns 334 * lib/net/smtp.rb (check_response): AUTH CRAM-MD5 returns 334

28
error.c
View file

@ -111,10 +111,12 @@ warn_print(fmt, args)
va_list args; va_list args;
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
int len;
err_snprintf(buf, BUFSIZ, fmt, args); err_snprintf(buf, BUFSIZ, fmt, args);
rb_write_error(buf); len = strlen(buf);
rb_write_error("\n"); buf[len++] = '\n';
rb_write_error2(buf, len);
} }
void void
@ -180,16 +182,18 @@ rb_bug(fmt, va_alist)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
va_list args; va_list args;
FILE *out = stderr;
int len = err_position(buf, BUFSIZ);
snprintf(buf, BUFSIZ, "[BUG] %s", fmt); if (fwrite(buf, 1, len, out) == len ||
ruby_in_eval = 0; fwrite(buf, 1, len, (out = stdout)) == len) {
fputs("[BUG] ", out);
va_init_list(args, fmt); va_init_list(args, fmt);
warn_print(buf, args); vfprintf(out, fmt, args);
va_end(args); va_end(args);
snprintf(buf, BUFSIZ, "ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM); fprintf(out, "\nruby %s (%s) [%s]\n\n",
rb_write_error(buf); RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
rb_write_error("\n"); }
abort(); abort();
} }
@ -758,7 +762,7 @@ rb_sys_fail(mesg)
errno = 0; errno = 0;
if (n == 0) { if (n == 0) {
rb_bug("rb_sys_fail() - errno == 0"); rb_bug("rb_sys_fail(%s) - errno == 0", mesg ? mesg : "");
} }
arg = mesg ? rb_str_new2(mesg) : Qnil; arg = mesg ? rb_str_new2(mesg) : Qnil;