1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
parent 2625e3425d
commit 73437c05f5
3 changed files with 18 additions and 11 deletions

View file

@ -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> Tue Apr 15 23:08:46 2008 Kouhei Sutou <kou@cozmixng.org>
* lib/xmlrpc/client.rb: fix cookie handling. [ruby-dev:34403] * lib/xmlrpc/client.rb: fix cookie handling. [ruby-dev:34403]

18
ruby.c
View file

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

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0" #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_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20080415 #define RUBY_RELEASE_CODE 20080416
#define RUBY_PATCHLEVEL 0 #define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0 #define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 4 #define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 15 #define RUBY_RELEASE_DAY 16
#ifdef RUBY_EXTERN #ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_version[];