Skip to content

Commit 8b53e2f

Browse files
author
(no author)
committed
This commit was manufactured by cvs2svn to create tag 'v1_8_5_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_8@11359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 74483e1 commit 8b53e2f

File tree

10 files changed

+113
-55
lines changed

10 files changed

+113
-55
lines changed

ChangeLog

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
Wed Dec 6 19:53:41 2006 WATANABE Hirofumi <eban@ruby-lang.org>
2+
3+
* configure.in (SITE_DIR): fixed to emtpy RUBY_SITE_LIB in config.h on
4+
NetBSD. fixed: [ruby-dev:29358]
5+
6+
Mon Dec 4 10:43:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
7+
8+
* parse.y (dyna_init_gen): dvar initialization only if dvar is
9+
assigned inner block. [ruby-talk:227402]
10+
11+
Mon Dec 4 10:22:26 2006 URABE Shyouhei <shyouhei@ice.uec.ac.jp>
12+
13+
* stable version 1.8.5-p2 relased.
14+
15+
Sun Dec 3 17:11:12 2006 Shugo Maeda <shugo@ruby-lang.org>
16+
17+
* lib/cgi.rb (CGI::QueryExtension::read_multipart): should quote
18+
boundary. JVN#84798830
19+
20+
Sun Nov 26 16:36:46 2006 URABE Shyouhei <shyouhei@ruby-lang.org>
21+
22+
* version.h: addition of RUBY_PATCHLEVEL.
23+
* version.c: ditto.
24+
25+
Fri Nov 24 10:17:51 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
26+
27+
* bignum.c (bignorm): avoid segmentation. a patch from Hiroyuki
28+
Ito <ZXB01226@nifty.com>. [ruby-list:43012]
29+
30+
Thu Nov 2 15:43:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
31+
32+
* parse.y (primary): should set NODE even when compstmt is NULL.
33+
merge from trunk. fixed: [ruby-dev:29732]
34+
35+
Sat Sep 23 21:34:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
36+
37+
* lib/cgi.rb (CGI::QueryExtension::read_multipart): CGI content
38+
may be empty. a patch from Jamis Buck <jamis at 37signals.com>.
39+
40+
Mon Sep 4 21:43:57 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
41+
42+
* ext/dbm/extconf.rb: create makefile according to the result of check
43+
for dbm header. fixed: [ruby-dev:29445]
44+
45+
Tue Aug 29 19:10:10 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
46+
47+
* hash.c (rb_hash_s_create): fixed memory leak, based on the patch
48+
by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233]
49+
50+
Fri Aug 25 17:15:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
51+
52+
* stable version 1.8.5 released.
53+
154
Fri Aug 25 17:02:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
255

356
* gc.c (gc_sweep): typo fixed.

bignum.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ static VALUE
9999
bignorm(x)
100100
VALUE x;
101101
{
102-
if (!FIXNUM_P(x)) {
102+
if (FIXNUM_P(x)) {
103+
return x;
104+
}
105+
else if (TYPE(x) == T_BIGNUM) {
103106
long len = RBIGNUM(x)->len;
104107
BDIGIT *ds = BDIGITS(x);
105108

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ AC_ARG_WITH(sitedir,
15191519
[ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
15201520
[sitedir=$withval],
15211521
[sitedir='${prefix}/lib/ruby/site_ruby'])
1522-
SITE_DIR="`eval \"echo ${sitedir}\"`"
1522+
SITE_DIR=`eval echo \\"${sitedir}\\"`
15231523
case "$target_os" in
15241524
cygwin*|mingw*|*djgpp*|os2-emx*)
15251525
RUBY_SITE_LIB_PATH="`expr "$SITE_DIR" : "$prefix\(/.*\)"`" ||

ext/dbm/extconf.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ def db_prefix(func)
4646
end
4747

4848
if dblib
49-
db_check(dblib)
49+
dbm_hdr = db_check(dblib)
5050
else
51-
for dblib in %w(db db2 db1 dbm gdbm gdbm_compat qdbm)
52-
db_check(dblib) and break
51+
dbm_hdr = %w(db db2 db1 dbm gdbm gdbm_compat qdbm).any? do |dblib|
52+
db_check(dblib)
5353
end
5454
end
5555

5656
have_header("cdefs.h")
5757
have_header("sys/cdefs.h")
58-
if /DBM_HDR/ =~ $CFLAGS and have_func(db_prefix("dbm_open"))
58+
if dbm_hdr and have_func(db_prefix("dbm_open"))
5959
have_func(db_prefix("dbm_clearerr")) unless $dbm_conf_have_gdbm
6060
create_makefile("dbm")
6161
end

hash.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,20 +223,31 @@ rb_hash_foreach(hash, func, farg)
223223
rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash);
224224
}
225225

226+
static VALUE hash_alloc0 _((VALUE));
226227
static VALUE hash_alloc _((VALUE));
227228
static VALUE
228-
hash_alloc(klass)
229+
hash_alloc0(klass)
229230
VALUE klass;
230231
{
231232
NEWOBJ(hash, struct RHash);
232233
OBJSETUP(hash, klass, T_HASH);
233234

234235
hash->ifnone = Qnil;
235-
hash->tbl = st_init_table(&objhash);
236236

237237
return (VALUE)hash;
238238
}
239239

240+
static VALUE
241+
hash_alloc(klass)
242+
VALUE klass;
243+
{
244+
VALUE hash = hash_alloc0(klass);
245+
246+
RHASH(hash)->tbl = st_init_table(&objhash);
247+
248+
return hash;
249+
}
250+
240251
VALUE
241252
rb_hash_new()
242253
{
@@ -325,9 +336,7 @@ rb_hash_s_create(argc, argv, klass)
325336
int i;
326337

327338
if (argc == 1 && TYPE(argv[0]) == T_HASH) {
328-
hash = hash_alloc(klass);
329-
330-
RHASH(hash)->ifnone = Qnil;
339+
hash = hash_alloc0(klass);
331340
RHASH(hash)->tbl = st_copy(RHASH(argv[0])->tbl);
332341

333342
return hash;

ia64.s

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/cgi.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ def params=(hash)
967967
def read_multipart(boundary, content_length)
968968
params = Hash.new([])
969969
boundary = "--" + boundary
970+
quoted_boundary = Regexp.quote(boundary, "n")
970971
buf = ""
971972
bufsize = 10 * 1024
972973
boundary_end=""
@@ -998,7 +999,7 @@ def read_multipart(boundary, content_length)
998999
end
9991000
body.binmode if defined? body.binmode
10001001

1001-
until head and /#{boundary}(?:#{EOL}|--)/n.match(buf)
1002+
until head and /#{quoted_boundary}(?:#{EOL}|--)/n.match(buf)
10021003

10031004
if (not head) and /#{EOL}#{EOL}/n.match(buf)
10041005
buf = buf.sub(/\A((?:.|\n)*?#{EOL})#{EOL}/n) do
@@ -1018,14 +1019,14 @@ def read_multipart(boundary, content_length)
10181019
else
10191020
stdinput.read(content_length)
10201021
end
1021-
if c.nil?
1022+
if c.nil? || c.empty?
10221023
raise EOFError, "bad content body"
10231024
end
10241025
buf.concat(c)
10251026
content_length -= c.size
10261027
end
10271028

1028-
buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{boundary}([\r\n]{1,2}|--)/n) do
1029+
buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{quoted_boundary}([\r\n]{1,2}|--)/n) do
10291030
body.print $1
10301031
if "--" == $2
10311032
content_length = -1

parse.y

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,8 @@ primary : literal
14811481
}
14821482
| tLPAREN compstmt ')'
14831483
{
1484-
$$ = $2;
1484+
if (!$2) $$ = NEW_NIL();
1485+
else $$ = $2;
14851486
}
14861487
| primary_value tCOLON2 tCONSTANT
14871488
{
@@ -4865,6 +4866,8 @@ gettable(id)
48654866
return 0;
48664867
}
48674868

4869+
static VALUE dyna_var_lookup _((ID id));
4870+
48684871
static NODE*
48694872
assignable(id, val)
48704873
ID id;
@@ -4893,7 +4896,7 @@ assignable(id, val)
48934896
if (rb_dvar_curr(id)) {
48944897
return NEW_DASGN_CURR(id, val);
48954898
}
4896-
else if (rb_dvar_defined(id)) {
4899+
else if (dyna_var_lookup(id)) {
48974900
return NEW_DASGN(id, val);
48984901
}
48994902
else if (local_id(id) || !dyna_in_block()) {
@@ -5735,6 +5738,22 @@ top_local_setup()
57355738
local_pop();
57365739
}
57375740

5741+
static VALUE
5742+
dyna_var_lookup(id)
5743+
ID id;
5744+
{
5745+
struct RVarmap *vars = ruby_dyna_vars;
5746+
5747+
while (vars) {
5748+
if (vars->id == id) {
5749+
vars->val = Qtrue;
5750+
return Qtrue;
5751+
}
5752+
vars = vars->next;
5753+
}
5754+
return Qfalse;
5755+
}
5756+
57385757
static struct RVarmap*
57395758
dyna_push()
57405759
{
@@ -5769,7 +5788,9 @@ dyna_init(node, pre)
57695788

57705789
if (!node || !post || pre == post) return node;
57715790
for (var = 0; post != pre && post->id; post = post->next) {
5772-
var = NEW_DASGN_CURR(post->id, var);
5791+
if (RTEST(post->val)) {
5792+
var = NEW_DASGN_CURR(post->id, var);
5793+
}
57735794
}
57745795
return block_append(var, node);
57755796
}

version.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
const char ruby_version[] = RUBY_VERSION;
1818
const char ruby_release_date[] = RUBY_RELEASE_DATE;
1919
const char ruby_platform[] = RUBY_PLATFORM;
20+
const int ruby_patchlevel = RUBY_PATCHLEVEL;
2021

2122
void
2223
Init_version()
@@ -28,6 +29,7 @@ Init_version()
2829
rb_define_global_const("RUBY_VERSION", v);
2930
rb_define_global_const("RUBY_RELEASE_DATE", d);
3031
rb_define_global_const("RUBY_PLATFORM", p);
32+
rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
3133

3234
/* obsolete constants */
3335
rb_define_global_const("VERSION", v);
@@ -38,7 +40,7 @@ Init_version()
3840
void
3941
ruby_show_version()
4042
{
41-
printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
43+
printf("ruby %s (%s patchlevel %d) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PATCHLEVEL, RUBY_PLATFORM);
4244
fflush(stdout);
4345
}
4446

version.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#define RUBY_VERSION "1.8.5"
2-
#define RUBY_RELEASE_DATE "2006-08-23"
2+
#define RUBY_RELEASE_DATE "2006-12-06"
33
#define RUBY_VERSION_CODE 185
4-
#define RUBY_RELEASE_CODE 20060823
4+
#define RUBY_RELEASE_CODE 20061206
5+
#define RUBY_PATCHLEVEL 8
56

67
#define RUBY_VERSION_MAJOR 1
78
#define RUBY_VERSION_MINOR 8
89
#define RUBY_VERSION_TEENY 5
910
#define RUBY_RELEASE_YEAR 2006
10-
#define RUBY_RELEASE_MONTH 8
11-
#define RUBY_RELEASE_DAY 23
11+
#define RUBY_RELEASE_MONTH 12
12+
#define RUBY_RELEASE_DAY 6
1213

1314
RUBY_EXTERN const char ruby_version[];
1415
RUBY_EXTERN const char ruby_release_date[];
1516
RUBY_EXTERN const char ruby_platform[];
17+
RUBY_EXTERN const int ruby_patchlevel;

0 commit comments

Comments
 (0)