summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-06 10:53:51 (GMT)
committer(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-06 10:53:51 (GMT)
commit519d92a01ec6d5d7e392c69200449c360120d20e (patch)
tree81d114776781ca5cecf9da1cfa20da0d1fde93ab
parent74483e11f55124cf9cd679a8964614fe8b354e4f (diff)
This commit was manufactured by cvs2svn to create tag 'v1_8_5_7'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_7@11357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog48
-rw-r--r--bignum.c5
-rw-r--r--ext/dbm/extconf.rb8
-rw-r--r--hash.c19
-rw-r--r--ia64.s33
-rw-r--r--lib/cgi.rb7
-rw-r--r--parse.y27
-rw-r--r--version.c4
-rw-r--r--version.h10
9 files changed, 107 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index 1825d8f..b552e39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,51 @@
+Mon Dec 4 10:43:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (dyna_init_gen): dvar initialization only if dvar is
+ assigned inner block. [ruby-talk:227402]
+
+Mon Dec 4 10:22:26 2006 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
+
+ * stable version 1.8.5-p2 relased.
+
+Sun Dec 3 17:11:12 2006 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
+ boundary. JVN#84798830
+
+Sun Nov 26 16:36:46 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * version.h: addition of RUBY_PATCHLEVEL.
+ * version.c: ditto.
+
+Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
+ Ito <ZXB01226@nifty.com>. [ruby-list:43012]
+
+Thu Nov 2 15:43:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * parse.y (primary): should set NODE even when compstmt is NULL.
+ merge from trunk. fixed: [ruby-dev:29732]
+
+Sat Sep 23 21:34:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/cgi.rb (CGI::QueryExtension::read_multipart): CGI content
+ may be empty. a patch from Jamis Buck <jamis at 37signals.com>.
+
+Mon Sep 4 21:43:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dbm/extconf.rb: create makefile according to the result of check
+ for dbm header. fixed: [ruby-dev:29445]
+
+Tue Aug 29 19:10:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_hash_s_create): fixed memory leak, based on the patch
+ by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233]
+
+Fri Aug 25 17:15:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * stable version 1.8.5 released.
+
Fri Aug 25 17:02:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (gc_sweep): typo fixed.
diff --git a/bignum.c b/bignum.c
index 6a7a83c..493550f 100644
--- a/bignum.c
+++ b/bignum.c
@@ -99,7 +99,10 @@ static VALUE
bignorm(x)
VALUE x;
{
- if (!FIXNUM_P(x)) {
+ if (FIXNUM_P(x)) {
+ return x;
+ }
+ else if (TYPE(x) == T_BIGNUM) {
long len = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x);
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 19bfc1f..52ec688 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -46,16 +46,16 @@ def db_prefix(func)
end
if dblib
- db_check(dblib)
+ dbm_hdr = db_check(dblib)
else
- for dblib in %w(db db2 db1 dbm gdbm gdbm_compat qdbm)
- db_check(dblib) and break
+ dbm_hdr = %w(db db2 db1 dbm gdbm gdbm_compat qdbm).any? do |dblib|
+ db_check(dblib)
end
end
have_header("cdefs.h")
have_header("sys/cdefs.h")
-if /DBM_HDR/ =~ $CFLAGS and have_func(db_prefix("dbm_open"))
+if dbm_hdr and have_func(db_prefix("dbm_open"))
have_func(db_prefix("dbm_clearerr")) unless $dbm_conf_have_gdbm
create_makefile("dbm")
end
diff --git a/hash.c b/hash.c
index dc804eb..0d4d433 100644
--- a/hash.c
+++ b/hash.c
@@ -223,20 +223,31 @@ rb_hash_foreach(hash, func, farg)
rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash);
}
+static VALUE hash_alloc0 _((VALUE));
static VALUE hash_alloc _((VALUE));
static VALUE
-hash_alloc(klass)
+hash_alloc0(klass)
VALUE klass;
{
NEWOBJ(hash, struct RHash);
OBJSETUP(hash, klass, T_HASH);
hash->ifnone = Qnil;
- hash->tbl = st_init_table(&objhash);
return (VALUE)hash;
}
+static VALUE
+hash_alloc(klass)
+ VALUE klass;
+{
+ VALUE hash = hash_alloc0(klass);
+
+ RHASH(hash)->tbl = st_init_table(&objhash);
+
+ return hash;
+}
+
VALUE
rb_hash_new()
{
@@ -325,9 +336,7 @@ rb_hash_s_create(argc, argv, klass)
int i;
if (argc == 1 && TYPE(argv[0]) == T_HASH) {
- hash = hash_alloc(klass);
-
- RHASH(hash)->ifnone = Qnil;
+ hash = hash_alloc0(klass);
RHASH(hash)->tbl = st_copy(RHASH(argv[0])->tbl);
return hash;
diff --git a/ia64.s b/ia64.s
deleted file mode 100644
index ba5241d..0000000
--- a/ia64.s
+++ /dev/null
@@ -1,33 +0,0 @@
-// rb_ia64_flushrs and rb_ia64_bsp is written in IA64 assembly language
-// because Intel Compiler for IA64 doesn't support inline assembly.
-//
-// This file is based on following C program compiled by gcc.
-//
-// void rb_ia64_flushrs(void) { __builtin_ia64_flushrs(); }
-// void *rb_ia64_bsp(void) { return __builtin_ia64_bsp(); }
-//
- .file "ia64.c"
- .text
- .align 16
- .global rb_ia64_flushrs#
- .proc rb_ia64_flushrs#
-rb_ia64_flushrs:
- .prologue
- .body
- flushrs
- ;;
- nop.i 0
- br.ret.sptk.many b0
- .endp rb_ia64_flushrs#
- .align 16
- .global rb_ia64_bsp#
- .proc rb_ia64_bsp#
-rb_ia64_bsp:
- .prologue
- .body
- nop.m 0
- ;;
- mov r8 = ar.bsp
- br.ret.sptk.many b0
- .endp rb_ia64_bsp#
- .ident "GCC: (GNU) 3.3.5 (Debian 1:3.3.5-13)"
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 1598df8..ac80d91 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -967,6 +967,7 @@ class CGI
def read_multipart(boundary, content_length)
params = Hash.new([])
boundary = "--" + boundary
+ quoted_boundary = Regexp.quote(boundary, "n")
buf = ""
bufsize = 10 * 1024
boundary_end=""
@@ -998,7 +999,7 @@ class CGI
end
body.binmode if defined? body.binmode
- until head and /#{boundary}(?:#{EOL}|--)/n.match(buf)
+ until head and /#{quoted_boundary}(?:#{EOL}|--)/n.match(buf)
if (not head) and /#{EOL}#{EOL}/n.match(buf)
buf = buf.sub(/\A((?:.|\n)*?#{EOL})#{EOL}/n) do
@@ -1018,14 +1019,14 @@ class CGI
else
stdinput.read(content_length)
end
- if c.nil?
+ if c.nil? || c.empty?
raise EOFError, "bad content body"
end
buf.concat(c)
content_length -= c.size
end
- buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{boundary}([\r\n]{1,2}|--)/n) do
+ buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{quoted_boundary}([\r\n]{1,2}|--)/n) do
body.print $1
if "--" == $2
content_length = -1
diff --git a/parse.y b/parse.y
index e2982f2..14561ca 100644
--- a/parse.y
+++ b/parse.y
@@ -1481,7 +1481,8 @@ primary : literal
}
| tLPAREN compstmt ')'
{
- $$ = $2;
+ if (!$2) $$ = NEW_NIL();
+ else $$ = $2;
}
| primary_value tCOLON2 tCONSTANT
{
@@ -4865,6 +4866,8 @@ gettable(id)
return 0;
}
+static VALUE dyna_var_lookup _((ID id));
+
static NODE*
assignable(id, val)
ID id;
@@ -4893,7 +4896,7 @@ assignable(id, val)
if (rb_dvar_curr(id)) {
return NEW_DASGN_CURR(id, val);
}
- else if (rb_dvar_defined(id)) {
+ else if (dyna_var_lookup(id)) {
return NEW_DASGN(id, val);
}
else if (local_id(id) || !dyna_in_block()) {
@@ -5735,6 +5738,22 @@ top_local_setup()
local_pop();
}
+static VALUE
+dyna_var_lookup(id)
+ ID id;
+{
+ struct RVarmap *vars = ruby_dyna_vars;
+
+ while (vars) {
+ if (vars->id == id) {
+ vars->val = Qtrue;
+ return Qtrue;
+ }
+ vars = vars->next;
+ }
+ return Qfalse;
+}
+
static struct RVarmap*
dyna_push()
{
@@ -5769,7 +5788,9 @@ dyna_init(node, pre)
if (!node || !post || pre == post) return node;
for (var = 0; post != pre && post->id; post = post->next) {
- var = NEW_DASGN_CURR(post->id, var);
+ if (RTEST(post->val)) {
+ var = NEW_DASGN_CURR(post->id, var);
+ }
}
return block_append(var, node);
}
diff --git a/version.c b/version.c
index 63c519a..b235673 100644
--- a/version.c
+++ b/version.c
@@ -17,6 +17,7 @@
const char ruby_version[] = RUBY_VERSION;
const char ruby_release_date[] = RUBY_RELEASE_DATE;
const char ruby_platform[] = RUBY_PLATFORM;
+const int ruby_patchlevel = RUBY_PATCHLEVEL;
void
Init_version()
@@ -28,6 +29,7 @@ Init_version()
rb_define_global_const("RUBY_VERSION", v);
rb_define_global_const("RUBY_RELEASE_DATE", d);
rb_define_global_const("RUBY_PLATFORM", p);
+ rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
/* obsolete constants */
rb_define_global_const("VERSION", v);
@@ -38,7 +40,7 @@ Init_version()
void
ruby_show_version()
{
- printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
+ printf("ruby %s (%s patchlevel %d) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PATCHLEVEL, RUBY_PLATFORM);
fflush(stdout);
}
diff --git a/version.h b/version.h
index a2c1803..06e0b32 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,17 @@
#define RUBY_VERSION "1.8.5"
-#define RUBY_RELEASE_DATE "2006-08-23"
+#define RUBY_RELEASE_DATE "2006-12-06"
#define RUBY_VERSION_CODE 185
-#define RUBY_RELEASE_CODE 20060823
+#define RUBY_RELEASE_CODE 20061206
+#define RUBY_PATCHLEVEL 7
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 5
#define RUBY_RELEASE_YEAR 2006
-#define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_MONTH 12
+#define RUBY_RELEASE_DAY 6
RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];
RUBY_EXTERN const char ruby_platform[];
+RUBY_EXTERN const int ruby_patchlevel;