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);