summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-01 02:50:59 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-01 02:50:59 (GMT)
commit9f37449f176d8943b765fc65c1adc5290e0f72ac (patch)
tree6ae308aaf787375933c3f0c1b276c464c038152f /template
parent513d8b349f3e37c3fa43a11148a68a2e14836fcb (diff)
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 c4ee2f1..75be215 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);