| 292 | | while ( ( ent = FileDirNext(dir) ) ) |
| 293 | | { |
| 294 | | if (ent->name[0] == '.') |
| 295 | | continue; |
| 296 | | |
| 297 | | if (SysStat(ent->name, &stat, dir->fd)) |
| 298 | | continue; |
| 299 | | |
| 300 | | /* Only files can be executed. */ |
| 301 | | if (!(stat.mode & _SYS_STAT_FILE)) |
| 302 | | continue; |
| 303 | | |
| 304 | | if (!strncasecmp(string, ent->name, strlen(string))) |
| 305 | | goto out; |
| | 292 | // printf("%s %s, %d\n", "/applications/", currPath, strcasecmp(currPath, "/applications/")); |
| | 293 | |
| | 294 | if (strcasecmp(currPath, "/applications/")) |
| | 295 | { |
| | 296 | while ( ( ent = FileDirNext(dir) ) ) |
| | 297 | { |
| | 298 | if (ent->name[0] == '.') |
| | 299 | continue; |
| | 300 | |
| | 301 | if (SysStat(ent->name, &stat, dir->fd)) |
| | 302 | continue; |
| | 303 | |
| | 304 | /* Only files can be executed. */ |
| | 305 | if (!(stat.mode & _SYS_STAT_FILE)) |
| | 306 | continue; |
| | 307 | |
| | 308 | if (!strncasecmp(string, ent->name, strlen(string))) |
| | 309 | goto out; |
| | 310 | } |