* ruby.c (ruby_init_loadpath): ensures buffer terminated
before use strncpy(). * ruby.c (proc_options): avoid SEGV at -S with no arguments. (ruby-bugs-ja:PR#391) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
168f2f470f
commit
2f6595c1ed
@ -1,3 +1,11 @@
|
|||||||
|
Thu Feb 13 09:58:12 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* ruby.c (ruby_init_loadpath): ensures buffer terminated
|
||||||
|
before use strncpy().
|
||||||
|
|
||||||
|
* ruby.c (proc_options): avoid SEGV at -S with no arguments.
|
||||||
|
(ruby-bugs-ja:PR#391)
|
||||||
|
|
||||||
Thu Feb 13 01:30:10 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Thu Feb 13 01:30:10 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* eval.c (rb_thread_schedule): current thread may be dead when
|
* eval.c (rb_thread_schedule): current thread may be dead when
|
||||||
|
15
ruby.c
15
ruby.c
@ -255,6 +255,7 @@ ruby_init_loadpath()
|
|||||||
_execname(libpath, FILENAME_MAX);
|
_execname(libpath, FILENAME_MAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
libpath[FILENAME_MAX] = '\0';
|
||||||
#ifdef DOSISH
|
#ifdef DOSISH
|
||||||
translate_char(libpath, '\\', '/');
|
translate_char(libpath, '\\', '/');
|
||||||
#endif
|
#endif
|
||||||
@ -704,14 +705,14 @@ proc_options(argc, argv)
|
|||||||
OBJ_TAINT(rb_load_path);
|
OBJ_TAINT(rb_load_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!e_script && argc == 0) { /* no more args */
|
if (argc == 0) { /* no more args */
|
||||||
|
if (!e_script) {
|
||||||
if (verbose) exit(0);
|
if (verbose) exit(0);
|
||||||
script = "-";
|
script = "-";
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (!e_script) {
|
|
||||||
script = argv[0];
|
|
||||||
}
|
}
|
||||||
|
else if (!e_script) {
|
||||||
|
script = argv[0];
|
||||||
if (script[0] == '\0') {
|
if (script[0] == '\0') {
|
||||||
script = "-";
|
script = "-";
|
||||||
}
|
}
|
||||||
@ -728,14 +729,12 @@ proc_options(argc, argv)
|
|||||||
}
|
}
|
||||||
if (!script) script = argv[0];
|
if (!script) script = argv[0];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!e_script) {
|
|
||||||
argc--; argv++;
|
|
||||||
}
|
|
||||||
#ifdef DOSISH
|
#ifdef DOSISH
|
||||||
translate_char(script, '\\', '/');
|
translate_char(script, '\\', '/');
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
argc--; argv++;
|
||||||
|
}
|
||||||
|
|
||||||
ruby_script(script);
|
ruby_script(script);
|
||||||
ruby_set_argv(argc, argv);
|
ruby_set_argv(argc, argv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user