ruby-changes:47812
From: nobu <ko1@a...>
Date: Sat, 16 Sep 2017 04:25:56 +0900 (JST)
Subject: [ruby-changes:47812] nobu:r59930 (trunk): ruby-runner.c: reduce duplicate code
nobu 2017-09-16 04:25:46 +0900 (Sat, 16 Sep 2017) New Revision: 59930 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59930 Log: ruby-runner.c: reduce duplicate code Modified files: trunk/ruby-runner.c Index: ruby-runner.c =================================================================== --- ruby-runner.c (revision 59929) +++ ruby-runner.c (revision 59930) @@ -40,11 +40,9 @@ main(int argc, char **argv) https://github.com/ruby/ruby/blob/trunk/ruby-runner.c#L40 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/