diff options
-rw-r--r-- | libbb/mingw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libbb/mingw.c b/libbb/mingw.c index 1293dc7eb..aa1417acf 100644 --- a/libbb/mingw.c +++ b/libbb/mingw.c | |||
@@ -203,11 +203,15 @@ static int do_lstat(const char *file_name, struct stat *buf) | |||
203 | WIN32_FILE_ATTRIBUTE_DATA fdata; | 203 | WIN32_FILE_ATTRIBUTE_DATA fdata; |
204 | 204 | ||
205 | if (!(errno = get_file_attr(file_name, &fdata))) { | 205 | if (!(errno = get_file_attr(file_name, &fdata))) { |
206 | int len = strlen(file_name); | ||
207 | |||
206 | buf->st_ino = 0; | 208 | buf->st_ino = 0; |
207 | buf->st_gid = 0; | 209 | buf->st_gid = 0; |
208 | buf->st_uid = 0; | 210 | buf->st_uid = 0; |
209 | buf->st_nlink = 1; | 211 | buf->st_nlink = 1; |
210 | buf->st_mode = file_attr_to_st_mode(fdata.dwFileAttributes); | 212 | buf->st_mode = file_attr_to_st_mode(fdata.dwFileAttributes); |
213 | if (len > 4 && !strcmp(file_name+len-4, ".exe")) | ||
214 | buf->st_mode |= S_IEXEC; | ||
211 | buf->st_size = fdata.nFileSizeLow | | 215 | buf->st_size = fdata.nFileSizeLow | |
212 | (((off_t)fdata.nFileSizeHigh)<<32); | 216 | (((off_t)fdata.nFileSizeHigh)<<32); |
213 | buf->st_dev = buf->st_rdev = 0; /* not used by Git */ | 217 | buf->st_dev = buf->st_rdev = 0; /* not used by Git */ |