aboutsummaryrefslogtreecommitdiff
path: root/coreutils/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/test.c')
-rw-r--r--coreutils/test.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/coreutils/test.c b/coreutils/test.c
index 4df505a05..139f1db75 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -642,6 +642,25 @@ static int filstat(char *nm, enum token mode)
642 return 0; 642 return 0;
643 } 643 }
644 644
645#if ENABLE_PLATFORM_MINGW32
646#undef R_OK
647#define R_OK S_IREAD
648#undef W_OK
649#define W_OK S_IWRITE
650 if (mode == FILEX) {
651 char *p;
652
653 if (file_is_executable(nm)) {
654 return 1;
655 }
656 else if ((p=win32_execable_file(nm))) {
657 free(p);
658 return 1;
659 }
660 return 0;
661 }
662#endif
663
645 if (stat(nm, &s) != 0) 664 if (stat(nm, &s) != 0)
646 return 0; 665 return 0;
647 if (mode == FILEXIST) 666 if (mode == FILEXIST)