summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-05 07:45:32 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-05 07:45:32 +0000
commit849bc0234abaa8458f132981404e198666c5610b (patch)
tree087d802ac34ba666eb197b3023171b77d9f0829c
parent1b33576053bc1f0a01deee86f9a5821cb96c65c0 (diff)
* eval.c (top_include): include in the wrapped load is done for
the wrapper, not for a singleton class for wrapped main. [ruby-dev:23305] * bignum.c (rb_big_eq): use temporary double variable to save the result (internal float register may be bigger than 64 bits, for example, 80 bits on x86). [ruby-dev:23311] * eval.c (block_pass): should generate unique identifier of the pushing block. [ruby-talk:96363] * ext/socket/socket.c (make_hostent): fix memory leak, based on the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog36
-rw-r--r--array.c2
-rw-r--r--bignum.c11
-rw-r--r--class.c2
-rw-r--r--eval.c35
-rw-r--r--ext/iconv/iconv.c2
-rw-r--r--ext/openssl/ossl.c2
-rw-r--r--ext/openssl/ossl_asn1.c10
-rw-r--r--ext/openssl/ossl_config.c2
-rw-r--r--ext/openssl/ossl_pkcs7.c2
-rw-r--r--ext/racc/cparse/cparse.c2
-rw-r--r--ext/readline/readline.c2
-rw-r--r--ext/sdbm/init.c2
-rw-r--r--ext/socket/socket.c69
-rw-r--r--ext/stringio/stringio.c2
-rw-r--r--ext/syslog/syslog.c2
-rw-r--r--ext/tcltklib/tcltklib.c2
-rw-r--r--ext/win32ole/win32ole.c80
-rw-r--r--file.c4
-rw-r--r--hash.c6
-rw-r--r--lib/net/http.rb8
-rw-r--r--lib/net/imap.rb2
-rw-r--r--lib/net/pop.rb4
-rw-r--r--lib/net/smtp.rb6
-rw-r--r--lib/wsdl/operation.rb2
-rw-r--r--lib/xmlrpc/parser.rb2
-rw-r--r--numeric.c1
-rw-r--r--re.c4
-rw-r--r--sprintf.c4
-rw-r--r--string.c10
-rw-r--r--struct.c2
-rw-r--r--time.c14
32 files changed, 197 insertions, 137 deletions
diff --git a/ChangeLog b/ChangeLog
index 7533bc4..51dd21c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,11 +34,34 @@ Sat Apr 3 17:11:05 2004 why the lucky stiff <why@ruby-lang.org>
* ext/syck/rubyext.c: handle base60, as well as hex and octal
with commas. implicit typing of ruby symbols.
+Fri Apr 2 17:27:17 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (top_include): include in the wrapped load is done for
+ the wrapper, not for a singleton class for wrapped main.
+ [ruby-dev:23305]
+
+Fri Apr 2 15:13:44 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (rb_big_eq): use temporary double variable to save the
+ result (internal float register may be bigger than 64 bits, for
+ example, 80 bits on x86). [ruby-dev:23311]
+
+Fri Apr 2 14:35:26 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (block_pass): should generate unique identifier of the
+ pushing block. [ruby-talk:96363]
+
+Fri Apr 2 07:31:38 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/socket/socket.c (make_hostent): fix memory leak, based on
+ the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>.
+
Thu Apr 1 19:58:37 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* lib/soap/mapping/{factory.rb,registry.rb}: fixed illegal mapped URI
object with soap/marshal.
added URIFactory class for URI mapping. BasetypeFactory checks
+
Thu Apr 1 22:55:33 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb: Allow rdoc comments in
@@ -98,6 +121,11 @@ Sat Mar 27 10:40:48 2004 Tanaka Akira <akr@m17n.org>
* (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
instead of PrettyPrint.
+Thu Mar 25 23:28:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * time.c (time_overflow_p): backport 1.9 usec overflow function.
+ (ruby-bugs PR#1307)
+
Thu Mar 25 23:15:24 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/ri/ri_options.rb (RI::Options::show_version):
@@ -169,6 +197,14 @@ Sat Mar 20 20:57:10 2004 David Black <dblack@wobblini.net>
* lib/scanf.rb: Backported 1.9 branch
modifications/corrections to 1.8 branch
+Sat Mar 20 23:51:03 2004 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * eval.c (rb_require_safe): preserve old ruby_errinfo.
+ [ruby-talk:95409]
+
+ * eval.c (rb_f_raise): should not clear backtrace information if
+ exception object already have one.
+
Sat Mar 20 15:25:36 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/template/html/html.rb (RDoc::Page): Force
diff --git a/array.c b/array.c
index b309ea0..4bdc202 100644
--- a/array.c
+++ b/array.c
@@ -1767,7 +1767,7 @@ rb_ary_select(argc, argv, ary)
long i;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new2(RARRAY(ary)->len);
for (i = 0; i < RARRAY(ary)->len; i++) {
diff --git a/bignum.c b/bignum.c
index a969fd2..f5ec1fe 100644
--- a/bignum.c
+++ b/bignum.c
@@ -962,10 +962,13 @@ rb_big_eq(x, y)
case T_BIGNUM:
break;
case T_FLOAT:
- if (rb_big2dbl(x) == RFLOAT(y)->value)
- return Qtrue;
- else
- return Qfalse;
+ {
+ double a, b;
+
+ a = RFLOAT(y)->value;
+ b = rb_big2dbl(x);
+ return (a == b)?Qtrue:Qfalse;
+ }
default:
return rb_equal(y, x);
}
diff --git a/class.c b/class.c
index 3842231..b84ba52 100644
--- a/class.c
+++ b/class.c
@@ -1015,7 +1015,7 @@ rb_scan_args(argc, argv, fmt, va_alist)
}
if (argc > i) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, i);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i);
}
return argc;
diff --git a/eval.c b/eval.c
index b24312e..347b7bc 100644
--- a/eval.c
+++ b/eval.c
@@ -3668,7 +3668,7 @@ rb_eval(self, n)
case NODE_ATTRSET:
if (ruby_frame->argc != 1)
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)",
ruby_frame->argc);
result = rb_ivar_set(self, node->nd_vid, ruby_frame->argv[0]);
break;
@@ -4448,7 +4448,8 @@ rb_f_raise(argc, argv)
if (argc > 0) {
if (!rb_obj_is_kind_of(mesg, rb_eException))
rb_raise(rb_eTypeError, "exception object expected");
- set_backtrace(mesg, (argc>2)?argv[2]:Qnil);
+ if (argc>2)
+ set_backtrace(mesg, argv[2]);
}
if (ruby_frame != top_frame) {
@@ -4890,7 +4891,7 @@ massign(self, node, val, pcall)
}
if (pcall && list) goto arg_error;
if (node->nd_args) {
- if (node->nd_args == (NODE*)-1) {
+ if ((int)(node->nd_args) == -1) {
/* no check for mere `*' */
}
else if (!list && i<len) {
@@ -5370,7 +5371,7 @@ call_cfunc(func, recv, len, argc, argv)
VALUE *argv;
{
if (len >= 0 && argc != len) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, len);
}
@@ -5521,7 +5522,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
/* for attr get/set */
case NODE_IVAR:
if (argc != 0) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_attr_get(recv, body->nd_vid);
break;
@@ -5588,10 +5589,10 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
i = node->nd_cnt;
if (i > argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, i);
}
- if (node->nd_rest == -1) {
+ if ((int)node->nd_rest == -1) {
int opt = i;
NODE *optnode = node->nd_opt;
@@ -5600,7 +5601,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
optnode = optnode->nd_next;
}
if (opt < argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, opt);
}
ruby_frame->argc = opt;
@@ -5626,7 +5627,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
}
}
local_vars = ruby_scope->local_vars;
- if (node->nd_rest >= 0) {
+ if ((int)node->nd_rest >= 0) {
VALUE v;
if (argc > 0)
@@ -6747,6 +6748,7 @@ rb_require_safe(fname, safe)
int safe;
{
VALUE result = Qnil;
+ volatile VALUE errinfo = ruby_errinfo;
int state;
struct {
NODE *node;
@@ -6824,7 +6826,7 @@ rb_require_safe(fname, safe)
if (NIL_P(result)) {
load_failed(fname);
}
- ruby_errinfo = Qnil;
+ ruby_errinfo = errinfo;
return result;
}
@@ -7236,7 +7238,7 @@ rb_obj_extend(argc, argv, obj)
int i;
if (argc == 0) {
- rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
}
for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
while (argc--) {
@@ -7263,12 +7265,10 @@ top_include(argc, argv, self)
{
rb_secure(4);
if (ruby_wrapper) {
- rb_warn("main#include in the wrapped load is effective only for toplevel");
- return rb_obj_extend(argc, argv, self);
- }
- else {
- return rb_mod_include(argc, argv, rb_cObject);
+ rb_warning("main#include in the wrapped load is effective only in wrapper module");
+ return rb_mod_include(argc, argv, ruby_wrapper);
}
+ return rb_mod_include(argc, argv, rb_cObject);
}
VALUE rb_f_trace_var();
@@ -8392,6 +8392,7 @@ block_pass(self, node)
old_block = ruby_block;
_block = *data;
_block.outer = ruby_block;
+ _block.uniq = block_unique++;
ruby_block = &_block;
PUSH_ITER(ITER_PRE);
if (ruby_frame->iter == ITER_NOT)
@@ -9089,7 +9090,7 @@ rb_mod_define_method(argc, argv, mod)
}
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) {
node = NEW_DMETHOD(method_unbind(body));
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 4b1f4b5..638fb71 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -595,7 +595,7 @@ iconv_s_iconv
struct iconv_env_t arg;
if (argc < 2) /* needs `to' and `from' arguments at least */
- rb_raise(rb_eArgError, "wrong # of arguments (%d for %d)", argc, 2);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, 2);
arg.argc = argc -= 2;
arg.argv = argv + 2;
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index ac98d6f..36a7aa5 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -63,7 +63,7 @@ ossl_x509_ary2sk0(VALUE ary)
val = rb_ary_entry(ary, i);
if (!rb_obj_is_kind_of(val, cX509Cert)) {
sk_X509_pop_free(sk, X509_free);
- ossl_raise(eOSSLError, "object except X509 cert is in array");
+ ossl_raise(eOSSLError, "object not X509 cert in array");
}
x509 = DupX509CertPtr(val); /* NEED TO DUP */
sk_X509_push(sk, x509);
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index f0d8dda..09ca66f 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -567,7 +567,7 @@ ossl_asn1_default_tag(VALUE obj)
return i;
}
}
- ossl_raise(eASN1Error, "not found universal tag for %s",
+ ossl_raise(eASN1Error, "universal tag for %s not found",
rb_class2name(CLASS_OF(obj)));
return -1; /* dummy */
@@ -650,7 +650,7 @@ ossl_asn1data_initialize(VALUE self, VALUE value, VALUE tag, VALUE tag_class)
if(!SYMBOL_P(tag_class))
ossl_raise(eASN1Error, "invalid tag class");
if((SYM2ID(tag_class) == sUNIVERSAL) && NUM2INT(tag) > 31)
- ossl_raise(eASN1Error, "too large tag number for Universal");
+ ossl_raise(eASN1Error, "tag number for Universal too large");
ossl_asn1_set_tag(self, tag);
ossl_asn1_set_value(self, value);
ossl_asn1_set_tag_class(self, tag_class);
@@ -865,13 +865,13 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
if(NIL_P(tagging))
tagging = ID2SYM(sEXPLICIT);
if(!SYMBOL_P(tagging))
- ossl_raise(eASN1Error, "invelid tag default");
+ ossl_raise(eASN1Error, "invalid tag default");
if(NIL_P(tag_class))
tag_class = ID2SYM(sCONTEXT_SPECIFIC);
if(!SYMBOL_P(tag_class))
- ossl_raise(eASN1Error, "invelid tag class");
+ ossl_raise(eASN1Error, "invalid tag class");
if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
- ossl_raise(eASN1Error, "too large tag number for Universal");
+ ossl_raise(eASN1Error, "tag number for Universal too large");
}
else{
tag = INT2NUM(ossl_asn1_default_tag(self));
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index 655517c..37abff5 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -147,7 +147,7 @@ ossl_config_initialize(int argc, VALUE *argv, VALUE self)
}
}
#ifdef OSSL_NO_CONF_API
- else rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ else rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
#else
else _CONF_new_data(conf);
#endif
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index aaa12ac..57825e8 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -358,7 +358,7 @@ ossl_pkcs7_set_detached(VALUE self, VALUE flag)
GetPKCS7(self, p7);
if(flag != Qtrue && flag != Qfalse)
- ossl_raise(ePKCS7Error, "must secify a boolean");
+ ossl_raise(ePKCS7Error, "must specify a boolean");
if(!PKCS7_set_detached(p7, flag == Qtrue ? 1 : 0))
ossl_raise(ePKCS7Error, NULL);
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index c15aaf5..24c4e36 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -733,7 +733,7 @@ reduce0(val, data, self)
/* calculate transition state */
if (RARRAY(v->state)->len == 0)
- rb_raise(RaccBug, "state stack unexpected empty");
+ rb_raise(RaccBug, "state stack unexpectedly empty");
k2 = num_to_long(LAST_I(v->state));
k1 = num_to_long(reduce_to) - v->nt_base;
D_printf("(goto) k1=%ld\n", k1);
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index cac0b1d..78a8b17 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -83,7 +83,7 @@ readline_s_set_completion_proc(self, proc)
VALUE proc;
{
if (!rb_respond_to(proc, rb_intern("call")))
- rb_raise(rb_eArgError, "argument have to respond to `call'");
+ rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_iv_set(mReadline, COMPLETION_PROC, proc);
}
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index f473555..4352d21 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -227,7 +227,7 @@ fsdbm_select(argc, argv, obj)
struct dbmdata *dbmp;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
GetDBM(obj, dbmp);
dbm = dbmp->di_dbm;
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 7c1b43b..d13f648 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -625,7 +625,8 @@ sock_addrinfo(host, port, socktype, flags)
VALUE host, port;
int socktype, flags;
{
- struct addrinfo hints, *hintsp, *res;
+ struct addrinfo hints;
+ struct addrinfo* res = NULL;
char *hostp, *portp;
int error;
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
@@ -637,13 +638,11 @@ sock_addrinfo(host, port, socktype, flags)
socktype = SOCK_DGRAM;
}
- hintsp = &hints;
MEMZERO(&hints, struct addrinfo, 1);
- hints.ai_family = PF_UNSPEC;
- hints.ai_protocol = 0;
+ hints.ai_family = AF_UNSPEC;
hints.ai_socktype = socktype;
hints.ai_flags = flags;
- error = getaddrinfo(hostp, portp, hintsp, &res);
+ error = getaddrinfo(hostp, portp, &hints, &res);
if (error) {
if (hostp && hostp[strlen(hostp)-1] == '\n') {
rb_raise(rb_eSocket, "newline at the end of hostname");
@@ -1043,39 +1042,43 @@ socks_s_close(sock)
#endif
#endif
+struct hostent_arg {
+ VALUE host;
+ struct addrinfo* addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t));
+};
+
static VALUE
-make_hostent(addr, ipaddr)
- struct addrinfo *addr;
- VALUE (*ipaddr) _((struct sockaddr*, size_t));
+make_hostent_internal(arg)
+ struct hostent_arg *arg;
{
+ VALUE host = arg->host;
+ struct addrinfo* addr = arg->addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t)) = arg->ipaddr;
+
struct addrinfo *ai;
struct hostent *h;
VALUE ary, names;
char **pch;
+ const char* hostp;
+ char hbuf[NI_MAXHOST];
ary = rb_ary_new();
- rb_ary_push(ary, rb_str_new2(addr->ai_canonname));
-#if defined(HAVE_GETIPNODEBYNAME)
- {
- int error;
-
- h = getipnodebyname(addr->ai_canonname, addr->ai_family, AI_ALL, &error);
+ if (addr->ai_canonname) {
+ hostp = addr->ai_canonname;
}
-#elif defined(HAVE_GETHOSTBYNAME2)
- h = gethostbyname2(addr->ai_canonname, addr->ai_family);
-#else
- h = gethostbyname(addr->ai_canonname);
-#endif
- if (h) {
+ else {
+ hostp = host_str(host, hbuf, sizeof(hbuf));
+ }
+ rb_ary_push(ary, rb_str_new2(hostp));
+
+ if (addr->ai_canonname && (h = gethostbyname(addr->ai_canonname))) {
names = rb_ary_new();
if (h->h_aliases != NULL) {
for (pch = h->h_aliases; *pch; pch++) {
rb_ary_push(names, rb_str_new2(*pch));
}
}
-#if defined(HAVE_GETIPNODEBYNAME)
- freehostent(h);
-#endif
}
else {
names = rb_ary_new2(0);
@@ -1089,6 +1092,22 @@ make_hostent(addr, ipaddr)
return ary;
}
+static VALUE
+make_hostent(host, addr, ipaddr)
+ VALUE host;
+ struct addrinfo* addr;
+ VALUE (*ipaddr)_((struct sockaddr*, size_t));
+{
+ VALUE ary;
+ struct hostent_arg arg;
+
+ arg.host = host;
+ arg.addr = addr;
+ arg.ipaddr = ipaddr;
+ ary = rb_ensure(make_hostent_internal, (VALUE)&arg,
+ RUBY_METHOD_FUNC(freeaddrinfo), (VALUE)addr);
+}
+
VALUE
tcp_sockaddr(addr, len)
struct sockaddr *addr;
@@ -1102,7 +1121,7 @@ tcp_s_gethostbyname(obj, host)
VALUE obj, host;
{
rb_secure(3);
- return make_hostent(sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), tcp_sockaddr);
+ return make_hostent(host, sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), tcp_sockaddr);
}
static VALUE
@@ -2013,7 +2032,7 @@ sock_s_gethostbyname(obj, host)
VALUE obj, host;
{
rb_secure(3);
- return make_hostent(sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
+ return make_hostent(host, sock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
}
static VALUE
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 46217c7..98d3c08 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -879,7 +879,7 @@ strio_read(argc, argv, self)
}
break;
default:
- rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
str = rb_str_substr(ptr->string, ptr->pos, len);
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index ce386ed..477489d 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -146,7 +146,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
VALUE pri;
if (argc < 2) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2+)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc);
}
argc--;
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 6e96289..271aa00 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -811,7 +811,7 @@ ip_ruby(clientData, interp, argc, argv)
/* ruby command has 1 arg. */
if (argc != 2) {
- rb_raise(rb_eArgError, "wrong # of arguments (%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
/* get C string from Tcl object */
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 8869ee0..0201057 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -73,7 +73,7 @@
#define OLEData_Get_Struct(obj, pole) {\
Data_Get_Struct(obj, struct oledata, pole);\
if(!pole->pDispatch) {\
- rb_raise(rb_eRuntimeError, "Fail to get Dispatch Interface");\
+ rb_raise(rb_eRuntimeError, "failed to get Dispatch Interface");\
}\
}
@@ -769,7 +769,7 @@ ole_val2variant(val, var)
if(pub) free(pub);
if(psab) free(psab);
if(pid) free(pid);
- rb_raise(rb_eRuntimeError, "memory allocate error");
+ rb_raise(rb_eRuntimeError, "memory allocation error");
}
val1 = val;
i = 0;
@@ -907,7 +907,7 @@ ole_variant2val(pvar)
if(pID) free(pID);
if(pLB) free(pLB);
if(pUB) free(pUB);
- rb_raise(rb_eRuntimeError, "memory allocate error");
+ rb_raise(rb_eRuntimeError, "memory allocation error");
}
obj = Qnil;
@@ -1361,7 +1361,7 @@ ole_create_dcom(argc, argv, self)
if (!gole32)
gole32 = LoadLibrary("OLE32");
if (!gole32)
- rb_raise(rb_eRuntimeError, "Fail to load OLE32.");
+ rb_raise(rb_eRuntimeError, "failed to load OLE32.");
if (!gCoCreateInstanceEx)
gCoCreateInstanceEx = (FNCOCREATEINSTANCEEX*)
GetProcAddress(gole32, "CoCreateInstanceEx");
@@ -1388,7 +1388,7 @@ ole_create_dcom(argc, argv, self)
SysFreeString(serverinfo.pwszName);
if (FAILED(hr))
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create DCOM server : `%s' in `%s'",
+ "failed to create DCOM server : `%s' in `%s'",
StringValuePtr(ole),
StringValuePtr(host));
@@ -1415,7 +1415,7 @@ ole_bind_obj(moniker, argc, argv, self)
hr = CreateBindCtx(0, &pBindCtx);
if(FAILED(hr)) {
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create bind context");
+ "failed to create bind context");
}
pbuf = ole_mb2wc(StringValuePtr(moniker), -1);
@@ -1492,7 +1492,7 @@ fole_s_connect(argc, argv, self)
if(FAILED(hr)) {
OLE_RELEASE(pUnknown);
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create WIN32OLE server : `%s'",
+ "failed to create WIN32OLE server : `%s'",
StringValuePtr(svr_name));
}
@@ -1536,12 +1536,12 @@ fole_s_const_load(argc, argv, self)
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
if(FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
OLE_RELEASE(pTypeInfo);
if(TYPE(klass) != T_NIL) {
@@ -1561,7 +1561,7 @@ fole_s_const_load(argc, argv, self)
hr = LoadTypeLibEx(pBuf, REGKIND_NONE, &pTypeLib);
SysFreeString(pBuf);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
if(TYPE(klass) != T_NIL) {
ole_const_load(pTypeLib, klass, self);
}
@@ -1717,11 +1717,11 @@ fole_s_show_help(argc, argv, self)
helpfile = target;
}
if (TYPE(helpfile) != T_STRING) {
- rb_raise(rb_eTypeError, "1st parametor must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD).");
+ rb_raise(rb_eTypeError, "1st parameter must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD).");
}
hwnd = ole_show_help(helpfile, helpcontext);
if(hwnd == 0) {
- rb_raise(rb_eRuntimeError, "fail to open help file:%s",
+ rb_raise(rb_eRuntimeError, "failed to open help file:%s",
StringValuePtr(helpfile));
}
return Qnil;
@@ -1775,7 +1775,7 @@ fole_initialize(argc, argv, self)
&IID_IDispatch, (void**)&pDispatch);
if(FAILED(hr)) {
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create WIN32OLE object from `%s'",
+ "failed to create WIN32OLE object from `%s'",
StringValuePtr(svr_name));
}
@@ -1876,7 +1876,7 @@ ole_invoke(argc, argv, self, wFlags)
rb_scan_args(argc, argv, "1*", &cmd, &paramS);
OLEData_Get_Struct(self, pole);
if(!pole->pDispatch) {
- rb_raise(rb_eRuntimeError, "Fail to get dispatch interface.");
+ rb_raise(rb_eRuntimeError, "failed to get dispatch interface.");
}
wcmdname = ole_mb2wc(StringValuePtr(cmd), -1);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
@@ -2431,7 +2431,7 @@ fole_each(self)
if (FAILED(hr)) {
VariantClear(&result);
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to get IEnum Interface");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to get IEnum Interface");
}
if (V_VT(&result) == VT_UNKNOWN)
@@ -2444,7 +2444,7 @@ fole_each(self)
(void**)&pEnum);
if (FAILED(hr) || !pEnum) {
VariantClear(&result);
- ole_raise(hr, rb_eRuntimeError, "Fail to get IEnum Interface");
+ ole_raise(hr, rb_eRuntimeError, "failed to get IEnum Interface");
}
VariantClear(&result);
@@ -2499,7 +2499,7 @@ ole_method_sub(self, pOwnerTypeInfo, pTypeInfo, name)
VALUE method = Qnil;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
@@ -2538,7 +2538,7 @@ olemethod_from_typeinfo(self, pTypeInfo, name)
VALUE method = Qnil;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
method = ole_method_sub(self, 0, pTypeInfo, name);
if (method != Qnil) {
@@ -2574,7 +2574,7 @@ ole_methods_sub(pOwnerTypeInfo, pTypeInfo, methods, mask)
WORD i;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs; i++) {
pstr = NULL;
@@ -2615,7 +2615,7 @@ ole_methods_from_typeinfo(pTypeInfo, mask)
VALUE methods = rb_ary_new();
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
ole_methods_sub(0, pTypeInfo, methods, mask);
@@ -2648,7 +2648,7 @@ typeinfo_from_ole(pole, ppti)
HRESULT hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo,
-1,
@@ -2658,7 +2658,7 @@ typeinfo_from_ole(pole, ppti)
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &i);
OLE_RELEASE(pTypeInfo);
if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
for (i = 0; i < count; i++) {
@@ -2773,12 +2773,12 @@ fole_obj_help( self )
hr = pole->pDispatch->lpVtbl->GetTypeInfo( pole->pDispatch, 0, lcid, &pTypeInfo );
if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
if(FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
&bstr, NULL, NULL, NULL);
@@ -3011,7 +3011,7 @@ fole_method_help( self, cmdname )
OLEData_Get_Struct(self, pole);
hr = typeinfo_from_ole(pole, &pTypeInfo);
if(FAILED(hr))
- ole_raise(hr, rb_eRuntimeError, "fail to get ITypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to get ITypeInfo");
method = folemethod_s_allocate(cWIN32OLE_METHOD);
obj = olemethod_from_typeinfo(method, pTypeInfo, cmdname);
OLE_RELEASE(pTypeInfo);
@@ -3046,7 +3046,7 @@ foletype_s_ole_classes(self, typelib)
pbuf = ole_mb2wc(StringValuePtr(file), -1);
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
SysFreeString(pbuf);
ole_classes_from_typelib(pTypeLib, classes);
OLE_RELEASE(pTypeLib);
@@ -3221,7 +3221,7 @@ foletype_initialize(self, typelib, oleclass)
pbuf = ole_mb2wc(StringValuePtr(file), -1);
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
SysFreeString(pbuf);
if (oleclass_from_typelib(self, pTypeLib, oleclass) == Qfalse) {
OLE_RELEASE(pTypeLib);
@@ -3414,7 +3414,7 @@ ole_type_major_version(pTypeInfo)
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
ver = INT2FIX(pTypeAttr->wMajorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
@@ -3443,7 +3443,7 @@ ole_type_minor_version(pTypeInfo)
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
ver = INT2FIX(pTypeAttr->wMinorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
@@ -3472,7 +3472,7 @@ ole_type_typekind(pTypeInfo)
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
typekind = INT2FIX(pTypeAttr->typekind);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return typekind;
@@ -3622,7 +3622,7 @@ ole_variables(pTypeInfo)
VALUE variables = rb_ary_new();
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cVars; i++) {
@@ -3702,7 +3702,7 @@ static ole_variable_ole_type(pTypeInfo, var_index)
VALUE type;
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetVarDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
type = ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
return type;
@@ -3731,7 +3731,7 @@ static ole_variable_ole_type_detail(pTypeInfo, var_index)
VALUE type = rb_ary_new();
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetVarDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), type);
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
return type;
@@ -3970,7 +3970,7 @@ ole_method_return_type(pTypeInfo, method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
@@ -4002,7 +4002,7 @@ ole_method_return_vtype(pTypeInfo, method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
vt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
@@ -4066,7 +4066,7 @@ ole_method_invkind(pTypeInfo, method_index)
VALUE invkind;
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if(FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
invkind = INT2FIX(pFuncDesc->invkind);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return invkind;
@@ -5269,7 +5269,7 @@ fev_initialize(argc, argv, self)
rb_scan_args(argc, argv, "11", &ole, &itf);
if (!rb_obj_is_kind_of(ole, cWIN32OLE)) {
- rb_raise(rb_eTypeError, "1st parametor must be WIN32OLE object.");
+ rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE object.");
}
if(TYPE(itf) != T_NIL) {
@@ -5285,7 +5285,7 @@ fev_initialize(argc, argv, self)
hr = find_default_source(ole, &iid, &pTypeInfo);
}
if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "not found interface");
+ ole_raise(hr, rb_eRuntimeError, "interface not found");
}
OLEData_Get_Struct(ole, pole);
@@ -5296,7 +5296,7 @@ fev_initialize(argc, argv, self)
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
ole_raise(hr, rb_eRuntimeError,
- "fail to query IConnectionPointContainer");
+ "failed to query IConnectionPointContainer");
}
hr = pContainer->lpVtbl->FindConnectionPoint(pContainer,
@@ -5305,7 +5305,7 @@ fev_initialize(argc, argv, self)
OLE_RELEASE(pContainer);
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "fail to query IConnectionPoint");
+ ole_raise(hr, rb_eRuntimeError, "failed to query IConnectionPoint");
}
pIEV = EVENTSINK_Constructor();
pIEV->m_iid = iid;
diff --git a/file.c b/file.c
index 3bd7e6b..d897340 100644
--- a/file.c
+++ b/file.c
@@ -2062,7 +2062,7 @@ rb_file_s_umask(argc, argv)
omask = umask(NUM2INT(argv[0]));
}
else {
- rb_raise(rb_eArgError, "wrong number of argument");
+ rb_raise(rb_eArgError, "wrong number of arguments");
}
return INT2FIX(omask);
}
@@ -2942,7 +2942,7 @@ test_check(n, argc, argv)
int i;
n+=1;
- if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, n);
+ if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
for (i=1; i<n; i++) {
switch (TYPE(argv[i])) {
case T_STRING:
diff --git a/hash.c b/hash.c
index b15bd24..fc28976 100644
--- a/hash.c
+++ b/hash.c
@@ -286,7 +286,7 @@ rb_hash_s_create(argc, argv, klass)
}
if (argc % 2 != 0) {
- rb_raise(rb_eArgError, "odd number args for Hash");
+ rb_raise(rb_eArgError, "odd number of arguments for Hash");
}
hash = hash_alloc(klass);
@@ -802,7 +802,7 @@ rb_hash_select(argc, argv, hash)
VALUE result;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
rb_hash_foreach(hash, select_i, result);
@@ -2018,7 +2018,7 @@ env_select(argc, argv)
char **env;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
env = GET_ENVIRON(environ);
diff --git a/lib/net/http.rb b/lib/net/http.rb
index f519814..1943894 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -120,7 +120,7 @@ module Net # :nodoc:
#
# def fetch( uri_str, limit = 10 )
# # You should choose better exception.
- # raise ArgumentError, 'http redirect too deep' if limit == 0
+ # raise ArgumentError, 'HTTP redirect too deep' if limit == 0
#
# response = Net::HTTP.get_response(URI.parse(uri_str))
# case response
@@ -442,7 +442,7 @@ module Net # :nodoc:
# Finishes HTTP session and closes TCP connection.
# Raises IOError if not started.
def finish
- raise IOError, 'HTTP session not started yet' unless started?
+ raise IOError, 'HTTP session not yet started' unless started?
do_finish
end
@@ -1762,11 +1762,11 @@ module Net # :nodoc:
end
def stream_check
- raise IOError, 'try to read body out of block' if @socket.closed?
+ raise IOError, 'attempt to read body out of block' if @socket.closed?
end
def procdest(dest, block)
- raise ArgumentError, 'both of arg and block are given for HTTP method' \
+ raise ArgumentError, 'both arg and block given for HTTP method' \
if dest and block
if block
ReadAdapter.new(block)
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 85bef3c..641d50e 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -859,7 +859,7 @@ module Net # :nodoc:
# firewall.
# Errno::ETIMEDOUT:: connection timed out (possibly due to packets
# being dropped by an intervening firewall).
- # Errno::NETUNREACH:: there is no route to that network.
+ # Errno::ENETUNREACH:: there is no route to that network.
# SocketError:: hostname not known or other socket error.
# Net::IMAP::ByeResponseError:: we connected to the host, but they
# immediately said goodbye to us.
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 96e10f9..eb61c29 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -292,7 +292,7 @@ module Net
# This method must not be called while POP3 session is opened.
# This method raises POPAuthenticationError if authentication fails.
def auth_only( account, password )
- raise IOError, 'opening already opened POP session' if started?
+ raise IOError, 'opening previously opened POP session' if started?
start(account, password) {
;
}
@@ -445,7 +445,7 @@ module Net
# Finishes a POP3 session and closes TCP connection.
def finish
- raise IOError, 'POP session not started yet' unless started?
+ raise IOError, 'POP session not yet started' unless started?
do_finish
end
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 21c0481..62a5fc5 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -371,7 +371,7 @@ module Net # :nodoc:
# Finishes the SMTP session and closes TCP connection.
# Raises IOError if not started.
def finish
- raise IOError, 'not started yet' unless started?
+ raise IOError, 'not yet started' unless started?
do_finish
end
@@ -472,7 +472,7 @@ module Net # :nodoc:
def send0( from_addr, to_addrs )
raise IOError, 'closed session' unless @socket
- raise ArgumentError, 'mail destination does not given' if to_addrs.empty?
+ raise ArgumentError, 'mail destination not given' if to_addrs.empty?
if $SAFE > 0
raise SecurityError, 'tainted from_addr' if from_addr.tainted?
to_addrs.each do |to|
@@ -499,7 +499,7 @@ module Net # :nodoc:
private
def check_auth_args( user, secret, authtype )
- raise ArgumentError, 'both of user and secret are required'\
+ raise ArgumentError, 'both user and secret are required'\
unless user and secret
auth_method = "auth_#{authtype || 'cram_md5'}"
raise ArgumentError, "wrong auth type #{authtype}"\
diff --git a/lib/wsdl/operation.rb b/lib/wsdl/operation.rb
index be28446..228dc85 100644
--- a/lib/wsdl/operation.rb
+++ b/lib/wsdl/operation.rb
@@ -119,7 +119,7 @@ private
return parts.dup
end
if parts.length != result.length
- raise RuntimeError.new("Incomplete prarmeterOrder list.")
+ raise RuntimeError.new("Incomplete parameter order list.")
end
result
end
diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb
index 3576182..da214ba 100644
--- a/lib/xmlrpc/parser.rb
+++ b/lib/xmlrpc/parser.rb
@@ -467,7 +467,7 @@ module XMLRPC
else
# is a normal return value
raise "Missing return value!" if parser.params.size == 0
- raise "To many return values. Only one allowed!" if parser.params.size > 1
+ raise "Too many return values. Only one allowed!" if parser.params.size > 1
[true, parser.params[0]]
end
end
diff --git a/numeric.c b/numeric.c
index 8557ec1..a05bedd 100644
--- a/numeric.c
+++ b/numeric.c
@@ -842,7 +842,6 @@ flo_eq(x, y)
return num_equal(x, y);
}
a = RFLOAT(x)->value;
- if (isnan(a) || isnan(b)) return Qfalse;
return (a == b)?Qtrue:Qfalse;
}
diff --git a/re.c b/re.c
index fc68f44..5c0bf4d 100644
--- a/re.c
+++ b/re.c
@@ -1251,7 +1251,7 @@ match_select(argc, argv, match)
VALUE match;
{
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
else {
struct re_registers *regs = RMATCH(match)->regs;
@@ -1651,7 +1651,7 @@ rb_reg_initialize_m(argc, argv, self)
rb_check_frozen(self);
if (argc == 0 || argc > 3) {
- rb_raise(rb_eArgError, "wrong number of argument");
+ rb_raise(rb_eArgError, "wrong number of arguments");
}
if (TYPE(argv[0]) == T_REGEXP) {
if (argc > 1) {
diff --git a/sprintf.c b/sprintf.c
index 33ec8db..405f24d 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -108,7 +108,7 @@ sign_bits(base, p)
(posarg = -1, GETNTHARG(n))))
#define GETNTHARG(nth) \
- ((nth >= argc) ? (rb_raise(rb_eArgError, "too few argument."), 0) : argv[nth])
+ ((nth >= argc) ? (rb_raise(rb_eArgError, "too few arguments."), 0) : argv[nth])
#define GETASTER(val) do { \
t = p++; \
@@ -718,7 +718,7 @@ rb_f_sprintf(argc, argv)
* the format string may contain `n$'-style argument selector.
*/
if (RTEST(ruby_verbose) && nextarg < argc) {
- rb_raise(rb_eArgError, "too many argument for format string");
+ rb_raise(rb_eArgError, "too many arguments for format string");
}
#endif
rb_str_resize(result, blen);
diff --git a/string.c b/string.c
index 3fb123b..dc67c11 100644
--- a/string.c
+++ b/string.c
@@ -1588,7 +1588,7 @@ rb_str_aref_m(argc, argv, str)
return rb_str_substr(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]));
}
if (argc != 1) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
return rb_str_aref(str, argv[0]);
}
@@ -1782,7 +1782,7 @@ rb_str_aset_m(argc, argv, str)
return argv[2];
}
if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
return rb_str_aset(str, argv[0], argv[1]);
}
@@ -1854,7 +1854,7 @@ rb_str_slice_bang(argc, argv, str)
int i;
if (argc < 1 || 2 < argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
for (i=0; i<argc; i++) {
buf[i] = argv[i];
@@ -1928,7 +1928,7 @@ rb_str_sub_bang(argc, argv, str)
if (OBJ_TAINTED(repl)) tainted = 1;
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
pat = get_pat(argv[0], 1);
@@ -2032,7 +2032,7 @@ str_gsub(argc, argv, str, bang)
if (OBJ_TAINTED(repl)) tainted = 1;
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
pat = get_pat(argv[0], 1);
diff --git a/struct.c b/struct.c
index 9ad3046..900f8bd 100644
--- a/struct.c
+++ b/struct.c
@@ -726,7 +726,7 @@ rb_struct_select(argc, argv, s)
long i;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
for (i = 0; i < RSTRUCT(s)->len; i++) {
diff --git a/time.c b/time.c
index 2dec206..b6b16a1 100644
--- a/time.c
+++ b/time.c
@@ -110,10 +110,10 @@ time_init(time)
#define NMOD(x,y) ((y)-(-((x)+1)%(y))-1)
void
-time_overflow_p(sec, usec)
- time_t sec, usec;
+time_overflow_p(secp, usecp)
+ time_t *secp, *usecp;
{
- time_t tmp;
+ time_t tmp, sec = *secp, usec = *usecp;
if (usec >= 1000000) { /* usec positive overflow */
tmp = sec + usec / 1000000;
@@ -135,6 +135,8 @@ time_overflow_p(sec, usec)
if (sec < 0 || (sec == 0 && usec < 0))
rb_raise(rb_eArgError, "time must be positive");
#endif
+ *secp = sec;
+ *usecp = usec;
}
static VALUE
@@ -146,7 +148,7 @@ time_new_internal(klass, sec, usec)
struct time_object *tobj;
GetTimeval(time, tobj);
- time_overflow_p(sec, usec);
+ time_overflow_p(&sec, &usec);
tobj->tv.tv_sec = sec;
tobj->tv.tv_usec = usec;
@@ -1895,7 +1897,7 @@ time_mdump(time)
tm = gmtime(&t);
if ((tm->tm_year & 0x1ffff) != tm->tm_year)
- rb_raise(rb_eArgError, "too big year to marshal");
+ rb_raise(rb_eArgError, "year too big to marshal");
p = 0x1 << 31 | /* 1 */
tm->tm_year << 14 | /* 17 */
@@ -1990,7 +1992,7 @@ time_mload(time, str)
sec = make_time_t(&tm, Qtrue);
usec = (time_t)(s & 0xfffff);
}
- time_overflow_p(sec, usec);
+ time_overflow_p(&sec, &usec);
GetTimeval(time, tobj);
tobj->tm_got = 0;