X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fopen.cc;h=3325e72506cb3023911c870056265ef63b305fd5;hb=b3258244c84a7673db39c46cad96ddb63b131dae;hp=1e9c86fee1e0542a37796879e1bf53b6bc9fa5e3;hpb=0e8795b28c809861e81dd50653a5355333cbcd59;p=notmuch diff --git a/lib/open.cc b/lib/open.cc index 1e9c86fe..3325e725 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) {