X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=lib%2Fopen.cc;h=1ca69665c4e446ce4023b90713a86376c91310ee;hb=c84ccb70f3ed2b2228346499b5110311039a0ecf;hp=84b2d6b1e56d70b092b9f9d49f1f676c7f0f84bf;hpb=ccd2ef38718efa3c9268eb68ad54454609e4451c;p=notmuch diff --git a/lib/open.cc b/lib/open.cc index 84b2d6b1..1ca69665 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -209,8 +209,25 @@ _choose_database_path (void *ctx, } } if (! *database_path) { + notmuch_status_t status; + *database_path = _xdg_dir (ctx, "XDG_DATA_HOME", ".local/share", profile); - *split = true; + status = _db_dir_exists (*database_path, message); + if (status) { + *database_path = NULL; + } else { + *split = true; + } + } + + if (! *database_path) { + notmuch_status_t status; + + *database_path = talloc_asprintf (ctx, "%s/mail", getenv ("HOME")); + status = _db_dir_exists (*database_path, message); + if (status) { + *database_path = NULL; + } } if (*database_path == NULL) {