* Handle new directory creation in the root container.

This commit is contained in:
Justin Maggard 2009-05-11 18:11:07 +00:00
parent 126e923a8e
commit fed843a982

View File

@ -389,19 +389,10 @@ inotify_insert_directory(int fd, char *name, const char * path)
" where d.PATH = '%q' and REF_ID is NULL", parent_buf); " where d.PATH = '%q' and REF_ID is NULL", parent_buf);
if( sql_get_table(db, sql, &result, &rows, NULL) == SQLITE_OK ) if( sql_get_table(db, sql, &result, &rows, NULL) == SQLITE_OK )
{ {
if( rows ) id = strdup(rows?result[1]:BROWSEDIR_ID);
{
id = strdup(result[1]);
sqlite3_free_table(result);
insert_directory(name, path, BROWSEDIR_ID, id+2, get_next_available_id("OBJECTS", id)); insert_directory(name, path, BROWSEDIR_ID, id+2, get_next_available_id("OBJECTS", id));
free(id); free(id);
} }
else
{
sqlite3_free_table(result);
insert_directory(name, path, BROWSEDIR_ID, "", get_next_available_id("OBJECTS", id));
}
}
free(parent_buf); free(parent_buf);
sqlite3_free(sql); sqlite3_free(sql);