X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.c;h=dac19d8955ec231bf9177df2f2e358adfd24b587;hp=05aa52dce1d5b4e57949635b5bf2bc293f6c5174;hb=55c8ee9a862f8f25be84adb591564b3777d88135;hpb=5f8d44fa5b2d308b76f6942852d44c9e7ead4005 diff --git a/notmuch.c b/notmuch.c index 05aa52dc..dac19d89 100644 --- a/notmuch.c +++ b/notmuch.c @@ -310,25 +310,19 @@ setup_command (int argc, char *argv[]) "such as mb2md. In that case, press Control-C now and run notmuch again\n" "once the conversion is complete.\n\n"); - printf ("Top-level mail directory [~/mail]: "); - fflush (stdout); + { + char *default_path = notmuch_database_default_path (); + printf ("Top-level mail directory [%s]: ", default_path); + free (default_path); + fflush (stdout); + } mail_directory = read_line (); if (mail_directory == NULL || strlen (mail_directory) == 0) { - char *home; - if (mail_directory) free (mail_directory); - - home = getenv ("HOME"); - if (!home) { - fprintf (stderr, "Error: No mail directory provided HOME environment variable is not set.\n"); - fprintf (stderr, "Cowardly refusing to just guess where your mail might be.\n"); - exit (1); - } - - mail_directory = g_strdup_printf ("%s/mail", home); + mail_directory = notmuch_database_default_path (); } notmuch = notmuch_database_create (mail_directory);