* ruby.c (process_options): dln_find_file returns the pointer to a

static buffer, so should copy it.  [ruby-dev:34409]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-04-15 17:26:29 +00:00
Родитель 2625e3425d
Коммит 73437c05f5
3 изменённых файлов: 18 добавлений и 11 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Wed Apr 16 02:26:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (process_options): dln_find_file returns the pointer to a
static buffer, so should copy it. [ruby-dev:34409]
Tue Apr 15 23:08:46 2008 Kouhei Sutou <kou@cozmixng.org>
* lib/xmlrpc/client.rb: fix cookie handling. [ruby-dev:34403]

18
ruby.c
Просмотреть файл

@ -84,6 +84,7 @@ struct cmdline_options {
int verbose;
int yydebug;
char *script;
VALUE script_name;
VALUE e_script;
struct {
struct {
@ -934,6 +935,8 @@ opt_enc_index(VALUE enc_name)
return i;
}
VALUE rb_progname;
VALUE rb_argv0;
static int src_encoding_index = -1; /* TODO: VM private */
static VALUE
@ -1034,16 +1037,17 @@ process_options(VALUE arg)
if (!opt->script)
opt->script = argv[0];
}
#if defined DOSISH || defined __CYGWIN__
/* assume that we can change argv[n] if never change its length. */
translate_char(opt->script, '\\', '/');
#endif
argc--;
argv++;
}
}
ruby_script(opt->script);
#if defined DOSISH || defined __CYGWIN__
translate_char(RSTRING_PTR(rb_progname), '\\', '/');
#endif
opt->script_name = rb_str_new4(rb_progname);
opt->script = RSTRING_PTR(opt->script_name);
ruby_set_argv(argc, argv);
process_sflag(opt);
@ -1108,7 +1112,7 @@ process_options(VALUE arg)
}
return rb_iseq_new(tree, rb_str_new2("<main>"),
rb_str_new2(opt->script), Qfalse, ISEQ_TYPE_TOP);
opt->script_name, Qfalse, ISEQ_TYPE_TOP);
}
static NODE *
@ -1270,9 +1274,6 @@ rb_load_file(const char *fname)
return load_file(rb_parser_new(), fname, 0, &opt);
}
VALUE rb_progname;
VALUE rb_argv0;
#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
#if !defined(_WIN32) && !(defined(HAVE_SETENV) && defined(HAVE_UNSETENV))
#define USE_ENVSPACE_FOR_ARG0
@ -1288,6 +1289,7 @@ get_arglen(int argc, char **argv)
char *s = argv[0];
int i;
if (!argc) return 0;
s += strlen(s);
/* See if all the arguments are contiguous in memory */
for (i = 1; i < argc; i++) {

Просмотреть файл

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2008-04-15"
#define RUBY_RELEASE_DATE "2008-04-16"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20080415
#define RUBY_RELEASE_CODE 20080416
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 15
#define RUBY_RELEASE_DAY 16
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];