Commit 55c760dc 55c760dc7d7c972cd216d43a095c0291ed7304a5 by Sergey Poznyakoff

(_scan): Test for existence of the folder even if --fast was given. Exit with co…

…de 1 if the folder does not exist.
1 parent a1ebdad4
Showing 1 changed file with 16 additions and 18 deletions
......@@ -304,20 +304,6 @@ _scan (const char *name, int depth)
struct stat st;
size_t uid;
if (!recurse)
{
if (fast_mode && depth > 0)
{
memset (&info, 0, sizeof (info));
info.name = strdup (name);
install_folder_info (name, &info);
return;
}
if (depth > 1)
return;
}
dir = opendir (name);
if (!dir && errno == ENOENT)
......@@ -332,10 +318,7 @@ _scan (const char *name, int depth)
dir = opendir (name);
}
else
{
push_folder = 0;
return;
}
exit (1);
}
if (!dir)
......@@ -344,6 +327,21 @@ _scan (const char *name, int depth)
return;
}
if (!recurse)
{
closedir (dir);
if (fast_mode && depth > 0)
{
memset (&info, 0, sizeof (info));
info.name = strdup (name);
install_folder_info (name, &info);
return;
}
if (depth > 1)
return;
}
memset (&info, 0, sizeof (info));
info.name = strdup (name);
while ((entry = readdir (dir)))
......