summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-29 10:20:35 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-29 10:20:35 +0000
commit5f664fd092369bbd4c13b826af58821f071d49f0 (patch)
tree0ad8c7e6c70aeee33c6f445dfe3abdb6d7b38072
parentf1ab170ccd7a2bc6089889e4d61a8445a4a5152c (diff)
merge revision(s) 17586,17612:
* ruby.c (set_arg0, ruby_prog_init): freeze $0. a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>. * test/inlinetest.rb (InlineTest.in_progname): workaround for frozen $0. [ruby-dev:35261] * lib/test/unit/ui/console/testrunner.rb (TestRunner#finished): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--ruby.c10
-rw-r--r--version.h2
3 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c793ad..06000de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sun Jun 29 19:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/inlinetest.rb (InlineTest.in_progname): workaround for frozen
+ $0. [ruby-dev:35261]
+
+ * lib/test/unit/ui/console/testrunner.rb (TestRunner#finished): ditto.
+
+Sun Jun 29 19:19:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (set_arg0, ruby_prog_init): freeze $0. a patch from Keita
+ Yamaguchi <keita.yamaguchi at gmail.com>.
+
Sun Jun 29 18:33:33 2008 Tanaka Akira <akr@fsij.org>
* process.c: include sys/resource.h if HAVE_SYS_RESOURCE_H is defined.
diff --git a/ruby.c b/ruby.c
index 9c011ce..0f00a27 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1044,6 +1044,7 @@ set_arg0(val, id)
VALUE val;
ID id;
{
+ VALUE progname;
char *s;
long i;
#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
@@ -1068,10 +1069,10 @@ set_arg0(val, id)
j.pst_command = s;
pstat(PSTAT_SETCMD, j, i, 0, 0);
}
- rb_progname = rb_tainted_str_new(s, i);
+ progname = rb_tainted_str_new(s, i);
#elif defined(HAVE_SETPROCTITLE)
setproctitle("%.*s", (int)i, s);
- rb_progname = rb_tainted_str_new(s, i);
+ progname = rb_tainted_str_new(s, i);
#else
if (len == 0) {
char *s = origargv[0];
@@ -1106,8 +1107,9 @@ set_arg0(val, id)
if (++i < len) memset(s + 1, ' ', len - i);
for (i = 1; i < origargc; i++)
origargv[i] = s;
- rb_progname = rb_tainted_str_new2(origargv[0]);
+ progname = rb_tainted_str_new2(origargv[0]);
#endif
+ rb_progname = rb_obj_freeze(progname);
}
void
@@ -1115,7 +1117,7 @@ ruby_script(name)
const char *name;
{
if (name) {
- rb_progname = rb_tainted_str_new2(name);
+ rb_progname = rb_obj_freeze(rb_tainted_str_new2(name));
ruby_sourcefile = rb_source_filename(name);
}
}
diff --git a/version.h b/version.h
index 7ef905f..fd530ae 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-29"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080629
-#define RUBY_PATCHLEVEL 34
+#define RUBY_PATCHLEVEL 35
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8