From 56e2c5243fd1caa769f2dff7ebc819af60a2562b Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 25 Feb 2004 17:19:16 +0000 Subject: [PATCH] * process.c (rb_f_exec): get rid of SEGV when exec failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ process.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a5f15c1a6d..98853a4bc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 26 02:19:11 2004 Nobuyoshi Nakada + + * process.c (rb_f_exec): get rid of SEGV when exec failed. + Wed Feb 25 21:17:33 2004 Nobuyoshi Nakada * gc.c (obj_free), io.c (rb_io_fptr_finalize), rubyio.h (OpenFile): diff --git a/process.c b/process.c index 18c46c2659..cb201ebfff 100644 --- a/process.c +++ b/process.c @@ -901,7 +901,7 @@ extern char *dln_find_exe(); static void security(str) - char *str; + const char *str; { if (rb_env_path_tainted()) { if (rb_safe_level() > 0) { @@ -913,7 +913,7 @@ security(str) static int proc_exec_v(argv, prog) char **argv; - char *prog; + const char *prog; { int err; @@ -1232,7 +1232,7 @@ rb_f_exec(argc, argv) e.argv = argv; e.prog = prog ? RSTRING(prog)->ptr : 0; rb_exec(&e); - rb_sys_fail(RSTRING(argv[0])->ptr); + rb_sys_fail(e.prog); return Qnil; /* dummy */ }