From fed843a9822fd38330b0498ef19cdb9485f4b811 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Mon, 11 May 2009 18:11:07 +0000 Subject: [PATCH] * Handle new directory creation in the root container. --- inotify.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/inotify.c b/inotify.c index 2a8a639..3585f47 100644 --- a/inotify.c +++ b/inotify.c @@ -389,18 +389,9 @@ inotify_insert_directory(int fd, char *name, const char * path) " where d.PATH = '%q' and REF_ID is NULL", parent_buf); if( sql_get_table(db, sql, &result, &rows, NULL) == SQLITE_OK ) { - if( rows ) - { - id = strdup(result[1]); - sqlite3_free_table(result); - insert_directory(name, path, BROWSEDIR_ID, id+2, get_next_available_id("OBJECTS", id)); - free(id); - } - else - { - sqlite3_free_table(result); - insert_directory(name, path, BROWSEDIR_ID, "", get_next_available_id("OBJECTS", id)); - } + id = strdup(rows?result[1]:BROWSEDIR_ID); + insert_directory(name, path, BROWSEDIR_ID, id+2, get_next_available_id("OBJECTS", id)); + free(id); } free(parent_buf); sqlite3_free(sql);