memset(&si, 0x00, sizeof(si));
ext = get_extension(path);
- if (ext && !strcasecmp(ext, ".sh") && (path_env = getenv("PATH")))
+ if (ext && strcasecmp(ext, ".sh") == 0 && (path_env = getenv("PATH")))
sh = find_executable_in_path("sh.exe", NULL, path_env);
if (!sh && getenv("CCACHE_DETECT_SHEBANG")) {
/* Detect shebang. */
char buf[10];
fgets(buf, sizeof(buf), fp);
buf[9] = 0;
- if (!strcmp(buf, "#!/bin/sh") && (path_env = getenv("PATH")))
+ if (strcmp(buf, "#!/bin/sh") == 0 && (path_env = getenv("PATH")))
sh = find_executable_in_path("sh.exe", NULL, path_env);
fclose(fp);
}
compare_executable_name(const char *s1, const char *s2)
{
#ifdef _WIN32
- int ret = !strcasecmp(s1, s2);
- if (!ret) {
+ int eq = strcasecmp(s1, s2) == 0;
+ if (!eq) {
char *tmp;
x_asprintf(&tmp, "%s.exe", s2);
- ret = !strcasecmp(s1, tmp);
+ eq = strcasecmp(s1, tmp) == 0;
free(tmp);
}
- return ret;
+ return eq;
#else
- return !strcmp(s1, s2);
+ return strcmp(s1, s2) == 0;
#endif
}