diff options
Diffstat (limited to 'coreutils/test.c')
-rw-r--r-- | coreutils/test.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/coreutils/test.c b/coreutils/test.c index 88cc55050..6b16ffeb1 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=file_is_win32_executable(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) |