winegcc: Fix the file mode check.
This commit is contained in:
parent
de5bbbc2ff
commit
f12e9a026b
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue