From 0c950146a14fa2bb0a0bf542073b2cdca141afd1 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 18 May 2012 00:13:35 -0400 Subject: lib: Perform the same transformation to _notmuch_database_find_directory_id Now _notmuch_database_find_directory_id takes a flags argument, which it passes through to _notmuch_directory_create and can indicate if the directory does not exist. Again, callers have been updated, but retain their original behavior. --- lib/directory.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/directory.cc') diff --git a/lib/directory.cc b/lib/directory.cc index 83bb19bc..6a3ffed7 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -153,7 +153,13 @@ _notmuch_directory_create (notmuch_database_t *notmuch, _notmuch_database_split_path (local, path, &parent, &basename); - _notmuch_database_find_directory_id (notmuch, parent, &parent_id); + *status_ret = _notmuch_database_find_directory_id ( + notmuch, parent, NOTMUCH_FIND_CREATE, &parent_id); + if (*status_ret) { + notmuch_directory_destroy (directory); + directory = NULL; + goto DONE; + } if (basename) { term = talloc_asprintf (local, "%s%u:%s", -- cgit v1.2.3