From 47ea5cb1d0e3fa241e9676511ee197d1428bf349 Mon Sep 17 00:00:00 2001
From: Klaus Schmidinger <vdr@tvdr.de>
Date: Sun, 10 Feb 2008 12:41:18 +0100
Subject: Fixed detecting directories in cFileNameList::Load()

---
 HISTORY | 1 +
 tools.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/HISTORY b/HISTORY
index 2c5386ff..cacaf82d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -5610,3 +5610,4 @@ Video Disk Recorder Revision History
 - Changed the message "Upcoming VPS recording!" to "Upcoming recording!" because
   it applies to non-VPS recordings as well.
 - Fixed a loss of a timer's 'recording' flag after modifying it via MODT.
+- Fixed detecting directories in cFileNameList::Load().
diff --git a/tools.c b/tools.c
index 98d2501f..3ec66a2a 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: tools.c 1.140 2008/01/13 11:26:30 kls Exp $
+ * $Id: tools.c 1.141 2008/02/10 12:40:36 kls Exp $
  */
 
 #include "tools.h"
@@ -1241,8 +1241,8 @@ bool cFileNameList::Load(const char *Directory, bool DirsOnly)
               if (strcmp(e->d_name, ".") && strcmp(e->d_name, "..")) {
                  if (DirsOnly) {
                     struct stat ds;
-                    if (stat(e->d_name, &ds) == 0) {
-                       if (S_ISDIR(ds.st_mode))
+                    if (stat(AddDirectory(Directory, e->d_name), &ds) == 0) {
+                       if (!S_ISDIR(ds.st_mode))
                           continue;
                        }
                     }
-- 
cgit v1.2.3