summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-06 14:00:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-06 14:00:54 +0000
commitc96f53e1aa7a82a05d7eb11388d17f2ca73e4edf (patch)
tree3377751600ae0fbdebe4a5f234604853f9c3c394
parent4e8cfd8b47ad6730db7822ad952cb7d28d067c58 (diff)
* eval.c (rb_mod_modfunc): should break if m has no super class.
[ruby-dev:22498] * backport changes from 1.9 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog31
-rw-r--r--configure.in2
-rw-r--r--eval.c1
-rw-r--r--ext/syck/emitter.c2
-rw-r--r--ext/tk/lib/multi-tk.rb2
-rw-r--r--io.c33
-rw-r--r--lib/cgi/session.rb4
-rw-r--r--misc/ruby-mode.el5
-rw-r--r--pack.c14
9 files changed, 65 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 26a09a5..ad7d10a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
+Tue Jan 6 22:13:34 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_mod_modfunc): should break if m has no super class.
+ [ruby-dev:22498]
+
Tue Jan 6 21:55:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * io.c (fptr_finalize): should save errno just after failure.
+ * io.c (fptr_finalize): should save errno just after failure.w
[ruby-dev:22492]
Tue Jan 6 14:53:14 2004 Dave Thomas <dave@pragprog.com>
@@ -71,7 +76,16 @@ Fri Jan 2 14:54:11 2004 Dave Thomas <dave@pragprog.com>
Fix problem with labels not displaying in RI labeled
lists using BS and ANSI modes.
-Wed Dec 31 11:20:34 2003 <dave@pragprog.com>
+Fri Jan 2 01:50:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (argf_eof): ARGF.eof? should not have any side effect.
+ [ruby-dev:22469]
+
+Wed Dec 31 17:25:17 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (argf_each_byte): should return self. [ruby-dev:22465]
+
+Wed Dec 31 11:20:34 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Make
file referenced in "// in sss.c" relative to current file.
@@ -87,6 +101,19 @@ Wed Dec 31 01:33:05 2003 Dave Thomas <dave@pragprog.com>
* array.c, error.c, eval.c, io.c, prec.c, range.c, re.c,
string.c, time.c: Add RDoc for Kernel functions, and tidy.
+Tue Dec 30 19:39:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_f_readline): should raise EOFError at the end of
+ files. [ruby-dev:22458]
+
+ * io.c (argf_read): should concatenate input files when length
+ argument is nil. [ruby-dev:22450]
+
+ * io.c (argf_read): should update supplied string buffer (2nd
+ argument) even when IO#read is called multiple times.
+
+ * io.c: should initialize lineno by zero. [ruby-dev:22460]
+
Tue Dec 30 12:30:30 2003 Dave Thomas <dave@pragprog.com>
* lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): If a
diff --git a/configure.in b/configure.in
index 1704619..c51fd57 100644
--- a/configure.in
+++ b/configure.in
@@ -707,7 +707,7 @@ if test x"$enable_pthread" = xyes; then
else
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
- AC_CHECK_FUNC(nanosleep)
+ AC_CHECK_FUNCS(nanosleep)
if test x"$ac_cv_func_nanosleep" = xno; then
AC_CHECK_LIB(rt, nanosleep)
if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
diff --git a/eval.c b/eval.c
index 6d88111..3161f45 100644
--- a/eval.c
+++ b/eval.c
@@ -7055,6 +7055,7 @@ rb_mod_modfunc(argc, argv, module)
break; /* normal case: need not to follow 'super' link */
}
m = RCLASS(m)->super;
+ if (!m) break;
}
rb_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC);
}
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index 4dcc8b3..d373ed4 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -239,7 +239,7 @@ syck_emitter_write( SyckEmitter *e, char *str, long len )
long rest = e->bufsize - (e->marker - e->buffer);
if (len <= rest) break;
S_MEMCPY( e->marker, str, char, rest );
- e->marker += len;
+ e->marker += rest;
str += rest;
len -= rest;
syck_emitter_flush( e, 0 );
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index b6c8001..c2dcb4f 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -17,7 +17,7 @@ TclTkLib.mainloop_abort_on_exception = true
################################################
# exceptiopn to treat the return value from IP
class MultiTkIp_OK < Exception
- def self.send(thred, ret=nil)
+ def self.send(thread, ret=nil)
thread.raise self.new(ret)
end
diff --git a/io.c b/io.c
index 6b1dd4c..edce093 100644
--- a/io.c
+++ b/io.c
@@ -114,7 +114,7 @@ struct timeval rb_time_interval _((VALUE));
static VALUE filename, current_file;
static int gets_lineno;
static int init_p = 0, next_p = 0;
-static VALUE lineno;
+static VALUE lineno = FIX2INT(0);
#ifdef _STDIO_USES_IOSTREAM /* GNU libc */
# ifdef _IO_fpos_t
@@ -4105,7 +4105,8 @@ rb_f_readline(argc, argv)
{
VALUE line;
- NEXT_ARGF_FORWARD();
+ if (!next_argv()) rb_eof_error();
+ ARGF_FORWARD();
line = rb_f_gets(argc, argv);
if (NIL_P(line)) {
rb_eof_error();
@@ -4901,7 +4902,6 @@ argf_eof()
if (init_p == 0) return Qtrue;
ARGF_FORWARD();
if (rb_io_eof(current_file)) {
- next_p = 1;
return Qtrue;
}
}
@@ -4913,23 +4913,22 @@ argf_read(argc, argv)
int argc;
VALUE *argv;
{
- VALUE tmp, str;
+ VALUE tmp, str, length;
long len = 0;
- if (argc == 1 && !NIL_P(argv[0]))
+ rb_scan_args(argc, argv, "02", &length, &str);
+ if (!NIL_P(length)) {
len = NUM2LONG(argv[0]);
- str = Qnil;
+ }
+ if (!NIL_P(str)) {
+ StringValue(str);
+ rb_str_resize(str,0);
+ argv[1] = Qnil;
+ }
retry:
if (!next_argv()) {
- if (NIL_P(str)) {
- VALUE length;
-
- rb_scan_args(argc, argv, "02", &length, &str);
- if (NIL_P(str)) return rb_str_new(0,0);
- StringValue(str);
- rb_str_resize(str,0);
- }
+ if (NIL_P(str)) return rb_str_new(0,0);
return str;
}
if (TYPE(current_file) != T_FILE) {
@@ -4940,14 +4939,14 @@ argf_read(argc, argv)
}
if (NIL_P(str)) str = tmp;
else rb_str_append(str, tmp);
- if (NIL_P(tmp) || argc == 0) {
+ if (NIL_P(tmp) || NIL_P(length)) {
if (next_p != -1) {
argf_close(current_file);
next_p = 1;
goto retry;
}
}
- else if (argc == 1) {
+ else if (argc >= 1) {
if (RSTRING(str)->len < len) {
len -= RSTRING(str)->len;
argv[0] = INT2NUM(len);
@@ -5021,7 +5020,7 @@ argf_each_byte()
while (!NIL_P(byte = argf_getc())) {
rb_yield(byte);
}
- return Qnil;
+ return argf;
}
static VALUE
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 4ad6bf2..10266b5 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -209,8 +209,8 @@ class CGI
# session id is stored in a cookie.
#
# session_expires:: the time the current session expires, as a
- # +Time+ object. If not set, the session will continue
- # indefinitely.
+ # +Time+ object. If not set, the session will terminate
+ # when the user's browser is closed.
# session_domain:: the hostname domain for which this session is valid.
# If not set, defaults to the hostname of the server.
# session_secure:: if +true+, this session will only work over HTTPS.
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 631f78f..081218c 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -964,7 +964,10 @@ balanced expression is found."
;; get current method (or class/module)
(if (re-search-backward
(concat "^[ \t]*\\(def\\|class\\|module\\)[ \t]+"
- "\\(" ruby-symbol-re "+\\)")
+ "\\("
+ ;; \\. for class method
+ "\\(" ruby-symbol-re "\\|\\." "\\)"
+ "+\\)")
nil t)
(progn
(setq mlist (list (match-string 2)))
diff --git a/pack.c b/pack.c
index 4763c81..4edffd3 100644
--- a/pack.c
+++ b/pack.c
@@ -22,12 +22,14 @@
#endif
#ifdef NATINT_PACK
+# define OFF16B(p) ((char*)(p) + (natint?0:(sizeof(short) - SIZE16)))
+# define OFF32B(p) ((char*)(p) + (natint?0:(sizeof(long) - SIZE32)))
# define NATINT_I32(x) (natint?NUM2LONG(x):(NUM2I32(x)))
# define NATINT_U32(x) (natint?NUM2ULONG(x):(NUM2U32(x)))
# define NATINT_LEN(type,len) (natint?sizeof(type):(len))
# ifdef WORDS_BIGENDIAN
-# define OFF16(p) ((char*)(p) + (natint?0:(sizeof(short) - SIZE16)))
-# define OFF32(p) ((char*)(p) + (natint?0:(sizeof(long) - SIZE32)))
+# define OFF16(p) OFF16B(p)
+# define OFF32(p) OFF32B(p)
# endif
# define NATINT_HTOVS(x) (natint?htovs(x):htov16(x))
# define NATINT_HTOVL(x) (natint?htovl(x):htov32(x))
@@ -47,6 +49,10 @@
# define OFF16(p) (char*)(p)
# define OFF32(p) (char*)(p)
#endif
+#ifndef OFF16B
+# define OFF16B(p) (char*)(p)
+# define OFF32B(p) (char*)(p)
+#endif
#define define_swapx(x, xtype) \
static xtype \
@@ -1648,7 +1654,7 @@ pack_unpack(str, fmt)
PACK_LENGTH_ADJUST(unsigned short,2);
while (len-- > 0) {
unsigned short tmp = 0;
- memcpy(OFF16(&tmp), s, NATINT_LEN(unsigned short,2));
+ memcpy(OFF16B(&tmp), s, NATINT_LEN(unsigned short,2));
s += NATINT_LEN(unsigned short,2);
rb_ary_push(ary, UINT2NUM(ntohs(tmp)));
}
@@ -1659,7 +1665,7 @@ pack_unpack(str, fmt)
PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
unsigned long tmp = 0;
- memcpy(OFF32(&tmp), s, NATINT_LEN(unsigned long,4));
+ memcpy(OFF32B(&tmp), s, NATINT_LEN(unsigned long,4));
s += NATINT_LEN(unsigned long,4);
rb_ary_push(ary, ULONG2NUM(ntohl(tmp)));
}