Changeset 5447:f72fce68ca19
- Timestamp:
- 2008-07-02 09:26:17 (8 weeks ago)
- Author:
- Vladimir Marek <Vladimir.Marek@…>
- Branch:
- HEAD
- Message:
-
Use stat() instead of dirent->d_type to test for directory. Closes #3089.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5445
|
r5447
|
|
| | 1 | 2008-07-02 18:23 +0200 Rocco Rutte <pdmef@gmx.net> (7783502a04c7) |
| | 2 | |
| | 3 | * curs_main.c: Calculate menu->max after a possible resort in index |
| | 4 | (maybe changing number of messages). Closes #3088. |
| | 5 | |
| | 6 | 2008-07-02 18:08 +0200 Rocco Rutte <pdmef@gmx.net> (f41ba27be46f) |
| | 7 | |
| | 8 | * ChangeLog, curs_lib.c: Fix casts for progress update to prevent |
| | 9 | -ftrapv aborts to trigger. Closes #3018. |
| | 10 | |
| 1 | 11 | 2008-07-02 08:56 -0700 Brendan Cully <brendan@kublai.com> (c51c16db46cc) |
| 2 | 12 | |
-
|
r5438
|
r5447
|
|
| 42 | 42 | #include <fcntl.h> |
| 43 | 43 | #include <pwd.h> |
| | 44 | #include <sys/types.h> |
| 44 | 45 | #include <dirent.h> |
| 45 | 46 | |
| … |
… |
|
| 584 | 585 | struct dirent* de; |
| 585 | 586 | char cur[_POSIX_PATH_MAX]; |
| | 587 | struct stat statbuf; |
| 586 | 588 | int rc = 0; |
| 587 | 589 | |
| … |
… |
|
| 598 | 600 | snprintf (cur, sizeof (cur), "%s/%s", path, de->d_name); |
| 599 | 601 | /* XXX make nonrecursive version */ |
| 600 | | if (de->d_type == DT_DIR) |
| | 602 | |
| | 603 | if (stat(cur, &statbuf) == -1) |
| | 604 | { |
| | 605 | rc = 1; |
| | 606 | continue; |
| | 607 | } |
| | 608 | |
| | 609 | if (S_ISDIR (statbuf.st_mode)) |
| 601 | 610 | rc |= mutt_rmtree (cur); |
| 602 | 611 | else |