mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug #1200
- #1200 Directory d_type==DT_UNKNOWN is now handled correctly (thanks to Jakub Wilk).
This commit is contained in:
parent
0ea28ef8a3
commit
68a12908d2
2 changed files with 17 additions and 2 deletions
|
@ -20,6 +20,8 @@ Features
|
|||
Bugs
|
||||
+ #1196 Now builds on Hurd (thanks to Jakub Wilk).
|
||||
+ #1197 Now 'tasksh' recognizes Ctrl-D to exit.
|
||||
+ #1200 Directory d_type==DT_UNKNOWN is now handled correctly (thanks to Jakub
|
||||
Wilk).
|
||||
+ #1211 The 'dateformat' settings now default to the ISO-8601 standard of
|
||||
'Y-M-D' (thanks to Robin Björklin).
|
||||
+ #1222 The 'summary' report now obeys the 'color.label' setting (thanks to
|
||||
|
|
|
@ -117,8 +117,14 @@ bool Directory::remove_directory (const std::string& dir)
|
|||
else
|
||||
unlink ((dir + "/" + de->d_name).c_str ());
|
||||
#else
|
||||
if (de->d_type == DT_DIR ||
|
||||
de->d_type == DT_UNKNOWN)
|
||||
if (de->d_type == DT_UNKNOWN)
|
||||
{
|
||||
struct stat s;
|
||||
lstat ((dir + "/" + de->d_name).c_str (), &s);
|
||||
if (s.st_mode & S_IFDIR)
|
||||
de->d_type = DT_DIR;
|
||||
}
|
||||
if (de->d_type == DT_DIR)
|
||||
remove_directory (dir + "/" + de->d_name);
|
||||
else
|
||||
unlink ((dir + "/" + de->d_name).c_str ());
|
||||
|
@ -209,6 +215,13 @@ void Directory::list (
|
|||
else
|
||||
results.push_back (base + "/" + de->d_name);
|
||||
#else
|
||||
if (recursive && de->d_type == DT_UNKNOWN)
|
||||
{
|
||||
struct stat s;
|
||||
lstat ((base + "/" + de->d_name).c_str (), &s);
|
||||
if (s.st_mode & S_IFDIR)
|
||||
de->d_type = DT_DIR;
|
||||
}
|
||||
if (recursive && de->d_type == DT_DIR)
|
||||
list (base + "/" + de->d_name, results, recursive);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue