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

ruby-runner.c.in: trivial optimization

* template/ruby-runner.c.in (main): trivial optimization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-11-01 02:50:59 +00:00
parent 513d8b349f
commit 9f37449f17

View file

@ -15,10 +15,12 @@ main(int argc, char **argv)
{
static const char builddir[] = BUILDDIR;
const char *libpath = getenv(LIBPATHENV);
char c = 0;
if (libpath) {
while (*libpath == PATH_SEP) ++libpath;
while ((c = *libpath) == PATH_SEP) ++libpath;
}
if (libpath && *libpath) {
if (c) {
size_t n = strlen(libpath);
char *e = malloc(sizeof(builddir)+n+1);
memcpy(e, builddir, sizeof(builddir)-1);