aboutsummaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-01 02:50:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-01 02:50:59 +0000
commitf2b4fe7cfcd0ec59bfca856ff7fb4f3f11dff74b (patch)
tree6ae308aaf787375933c3f0c1b276c464c038152f /template
parent65f3f83816f04e33efc6d9f54a9e5c8367cb6e72 (diff)
downloadruby-f2b4fe7cfcd0ec59bfca856ff7fb4f3f11dff74b.tar.gz
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
Diffstat (limited to 'template')
-rw-r--r--template/ruby-runner.c.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/template/ruby-runner.c.in b/template/ruby-runner.c.in
index c4ee2f1ee4..75be21573f 100644
--- a/template/ruby-runner.c.in
+++ b/template/ruby-runner.c.in
@@ -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);