Commit f12e9a02 authored by Alexandre Julliard's avatar Alexandre Julliard

winegcc: Fix the file mode check.

parent de5bbbc2
......@@ -307,13 +307,10 @@ void spawn(const strarray* prefix, const strarray* args, int ignore_errors)
if (!(p = strrchr(argv[0], '/'))) p = argv[0];
free( prog );
prog = strmake("%s/%s", prefix->base[i], p);
if (stat(prog, &st) == 0)
if (stat(prog, &st) == 0 && S_ISREG(st.st_mode) && (st.st_mode & 0111))
{
if ((st.st_mode & S_IFREG) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
{
argv[0] = prog;
break;
}
argv[0] = prog;
break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment