зеркало из https://github.com/github/ruby.git
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:
Родитель
513d8b349f
Коммит
9f37449f17
|
@ -15,10 +15,12 @@ main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
static const char builddir[] = BUILDDIR;
|
static const char builddir[] = BUILDDIR;
|
||||||
const char *libpath = getenv(LIBPATHENV);
|
const char *libpath = getenv(LIBPATHENV);
|
||||||
|
char c = 0;
|
||||||
|
|
||||||
if (libpath) {
|
if (libpath) {
|
||||||
while (*libpath == PATH_SEP) ++libpath;
|
while ((c = *libpath) == PATH_SEP) ++libpath;
|
||||||
}
|
}
|
||||||
if (libpath && *libpath) {
|
if (c) {
|
||||||
size_t n = strlen(libpath);
|
size_t n = strlen(libpath);
|
||||||
char *e = malloc(sizeof(builddir)+n+1);
|
char *e = malloc(sizeof(builddir)+n+1);
|
||||||
memcpy(e, builddir, sizeof(builddir)-1);
|
memcpy(e, builddir, sizeof(builddir)-1);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче