summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-08-09 18:52:17 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-08-09 18:52:17 +0000
commit0f7416d677fce1b8b9ed9e6e837791caef06b81a (patch)
treee2746a468a7bb654bf6cc023121bb8631688d0af /main.c
parent90a7a88631475ff9d748865a42b0556fd0c409f5 (diff)
Various fixes. Additionally, mutt will now create the $folder
directory when started in curses mode and if it doesn't exist.
Diffstat (limited to 'main.c')
-rw-r--r--main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/main.c b/main.c
index 565bcae7..a8a4ab3d 100644
--- a/main.c
+++ b/main.c
@@ -279,7 +279,7 @@ static void show_version (void)
# ifdef _PGPV3PATH
printf ("_PGPV3PATH=\"%s\"\n", _PGPV3PATH);
# endif
-# ifdef _PGPGPPATH
+# ifdef _PGPGPGPATH
printf ("_PGPGPGPATH=\"%s\"\n", _PGPGPGPATH);
# endif
#endif
@@ -509,6 +509,26 @@ int main (int argc, char **argv)
mutt_error = mutt_curses_error;
}
+ /* Create the ~/Mail directory if it doesn't exist. */
+ if (!option (OPTNOCURSES) && Maildir)
+ {
+ struct stat sb;
+ char fpath[_POSIX_PATH_MAX];
+ char msg[STRING];
+
+ strfcpy (fpath, Maildir, sizeof (fpath));
+ mutt_expand_path (fpath, sizeof (fpath));
+ if (stat (fpath, &sb) == -1 && errno == ENOENT)
+ {
+ snprintf (msg, sizeof (msg), _("%s does not exist. Create it?"), Maildir);
+ if (mutt_yesorno (msg, 1) == 1)
+ {
+ if (mkdir (fpath, 0700) == -1 && errno != EEXIST)
+ mutt_error ( _("Can't create %s: %s."), Maildir, strerror (errno));
+ }
+ }
+ }
+
if (sendflags & SENDPOSTPONED)
{
if (!option (OPTNOCURSES))