updated: always call removeDeletedFromDirectory()
Removed the local variable "was_empty": don't remember if the directory is new. Always call removeDeletedFromDirectory().
This commit is contained in:
parent
84b52265a6
commit
b4f1b20fd9
@ -285,7 +285,6 @@ static int skip_path(const char *path)
|
|||||||
static enum update_return
|
static enum update_return
|
||||||
updateDirectory(struct directory *directory, const struct stat *st)
|
updateDirectory(struct directory *directory, const struct stat *st)
|
||||||
{
|
{
|
||||||
bool was_empty = directory_is_empty(directory);
|
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
const char *dirname = directory_get_path(directory);
|
const char *dirname = directory_get_path(directory);
|
||||||
struct dirent *ent;
|
struct dirent *ent;
|
||||||
@ -300,8 +299,7 @@ updateDirectory(struct directory *directory, const struct stat *st)
|
|||||||
if (!dir)
|
if (!dir)
|
||||||
return UPDATE_RETURN_ERROR;
|
return UPDATE_RETURN_ERROR;
|
||||||
|
|
||||||
if (!was_empty &&
|
if (removeDeletedFromDirectory(path_max_tmp, directory) > 0)
|
||||||
removeDeletedFromDirectory(path_max_tmp, directory) > 0)
|
|
||||||
ret = UPDATE_RETURN_UPDATED;
|
ret = UPDATE_RETURN_UPDATED;
|
||||||
|
|
||||||
while ((ent = readdir(dir))) {
|
while ((ent = readdir(dir))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user