diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-28 15:27:57 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-28 15:27:57 +1000 |
commit | 045c0eb7df3c169f006c8167c52648446cbdacc3 (patch) | |
tree | 074048b30ca84a765c8228aa96ea63143835d4b5 | |
parent | bf132771ae56b6d5c8e5d3d1c33c3b10c9862548 (diff) | |
download | busybox-w32-045c0eb7df3c169f006c8167c52648446cbdacc3.tar.gz busybox-w32-045c0eb7df3c169f006c8167c52648446cbdacc3.tar.bz2 busybox-w32-045c0eb7df3c169f006c8167c52648446cbdacc3.zip |
libb/mingw_stat(): turn S_IEXEC on for .exe files
-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 */ |