aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/directory.cc
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-05-18 00:13:35 -0400
committerGravatar David Bremner <bremner@debian.org>2012-05-23 22:30:32 -0300
commit0c950146a14fa2bb0a0bf542073b2cdca141afd1 (patch)
tree2dcbc9faabb6cda485b05324041c0a5821c44ce6 /lib/directory.cc
parentf69314fbd37f403a395b7c1c44595c8f696b05b7 (diff)
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.
Diffstat (limited to 'lib/directory.cc')
-rw-r--r--lib/directory.cc8
1 files changed, 7 insertions, 1 deletions
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",