Commit Diff
- Commit:
367a887c7ef88a3899ecddf946802ff3d3f6f759
- From:
- Marcel Rodrigues <marcelgmr@gmail.com>
- Date:
- Message:
- Check whether symlink target is a directory. Previously we're using lstat() to make file sizes reflect the actual size occupied by an entry (symbolic links are just small references). However, we need to dereference links in order to know the correct type of their target.
- Actions:
- Patch | Tree
--- rover.c +++ rover.c @@ -454,7 +454,7 @@ ls(Row **rowsp, uint8_t flags) continue; if (!(flags & SHOW_HIDDEN) && ep->d_name[0] == '.') continue; - lstat(ep->d_name, &statbuf); + stat(ep->d_name, &statbuf); if (S_ISDIR(statbuf.st_mode)) { if (flags & SHOW_DIRS) { rows[i].name = malloc(strlen(ep->d_name) + 2);