Module: wine Branch: master Commit: f12e9a026b7170ef6f77f57accd1589141bd5658 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f12e9a026b7170ef6f77f57acc...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Dec 12 12:01:46 2008 +0100
winegcc: Fix the file mode check.
---
tools/winegcc/utils.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index 225062d..f30a8c3 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c @@ -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; } } }