Changeset 5447:f72fce68ca19

Show
Ignore:
Timestamp:
2008-07-02 09:26:17 (7 weeks ago)
Author:
Vladimir Marek <Vladimir.Marek@…>
Branch:
HEAD
Message:

Use stat() instead of dirent->d_type to test for directory. Closes #3089.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5445 r5447  
     12008-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 
     62008-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 
    1112008-07-02 08:56 -0700  Brendan Cully  <brendan@kublai.com>  (c51c16db46cc) 
    212 
  • lib.c

    r5438 r5447  
    4242#include <fcntl.h> 
    4343#include <pwd.h> 
     44#include <sys/types.h> 
    4445#include <dirent.h> 
    4546 
     
    584585  struct dirent* de; 
    585586  char cur[_POSIX_PATH_MAX]; 
     587  struct stat statbuf; 
    586588  int rc = 0; 
    587589 
     
    598600    snprintf (cur, sizeof (cur), "%s/%s", path, de->d_name); 
    599601    /* 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)) 
    601610      rc |= mutt_rmtree (cur); 
    602611    else