From 9bee14ce95a8130aec3867958acf237055469601 Mon Sep 17 00:00:00 2001 From: Gerd von Egidy Date: Wed, 16 Dec 2015 23:59:32 +0100 Subject: [PATCH] fix symlink-dir-bug by switching from stat() to our Stat-class and using it's follow_links=false --- src/filefunc.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filefunc.cpp b/src/filefunc.cpp index c71b27d..a19d760 100644 --- a/src/filefunc.cpp +++ b/src/filefunc.cpp @@ -749,11 +749,11 @@ bool recursive_delete(const std::string &path, try { - struct stat my_stat; - if (stat(path.c_str(), &my_stat) != 0) + Stat sp(path, false); + if (!sp) throw runtime_error("can't stat " + path); - if (S_ISDIR(my_stat.st_mode)) + if (sp.is_directory()) { DIR *dir = opendir(path.c_str()); if (!dir) -- 1.7.1