mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ruby-runner.c: reduce duplicate code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
84181a6c88
commit
4075d71c18
1 changed files with 2 additions and 4 deletions
|
@ -40,11 +40,9 @@ main(int argc, char **argv)
|
|||
if (strlen(p) < namesize - 1) {
|
||||
argv[0] = malloc(p - arg0 + namesize);
|
||||
memcpy(argv[0], arg0, p - arg0);
|
||||
memcpy(argv[0] + (p - arg0), rubypath + dirsize, namesize);
|
||||
}
|
||||
else {
|
||||
memcpy(p, rubyname, namesize);
|
||||
p = argv[0] + (p - arg0);
|
||||
}
|
||||
memcpy(p, rubyname, namesize);
|
||||
|
||||
execv(rubypath, argv);
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue