X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Finc.c;h=f2d2e77901635e0f49c4196c037cd0af301e0e41;hb=045101c0a79f43fe566422622f154d5cc0141d8a;hp=aee194aa39c6ab3539e8d3afe60494ddf2bdb696;hpb=8c1b8e55ba6269af3f6be282eeb7b5a19516315f;p=mmh diff --git a/uip/inc.c b/uip/inc.c index aee194a..f2d2e77 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -223,8 +223,8 @@ static FILE *in; */ char *map_name(char *); +static int inc_done(int); #ifdef POP -int done(int); static int pop_action(char *); static int pop_pack(char *); static int map_count(void); @@ -263,6 +263,8 @@ main (int argc, char **argv) struct hes_postoffice *po; #endif + done=inc_done; + /* absolutely the first thing we do is save our privileges, * and drop them if we can. */ @@ -457,7 +459,7 @@ main (int argc, char **argv) if (folder) adios (NULL, "only one folder at a time!"); else - folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF); + folder = pluspath (cp); } else { adios (NULL, "usage: %s [+folder] [switches]", invo_name); } @@ -563,10 +565,15 @@ main (int argc, char **argv) if ((maildir_copy = strdup(maildir)) == (char *)0) adios (maildir, "error allocating memory to copy maildir"); - if (noisy) - create_folder(maildir, 0, done); - else - done (1); + if (!folder_exists(maildir)) { + /* If the folder doesn't exist, and we're given the -silent flag, + * just fail. + */ + if (noisy) + create_folder(maildir, 0, done); + else + done (1); + } if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); @@ -982,8 +989,8 @@ cpymsg (FILE *in, FILE *out) #endif /* if 0 */ -int -done (int status) +static int +inc_done (int status) { #ifdef POP if (packfile && pd != NOTOK)