X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/da4e8725cdfeb62527f9b900f3a21afc88e89e3a..ddf3a8574f657dcb8c53fc5908e7bebbde1994b5:/uip/inc.c diff --git a/uip/inc.c b/uip/inc.c index e40b7306..c34d28ae 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -477,55 +477,55 @@ main (int argc, char **argv) } if (stat (newmail, &s1) == NOTOK || s1.st_size == 0) die("no mail to incorporate"); - if (s1.st_mode & S_IFDIR) { - DIR *md; - struct dirent *de; - struct stat ms; - int i; - i = 0; - cp = concat (newmail, "/new", NULL); - if ((md = opendir(cp)) == NULL) - die("unable to open %s", cp); - while ((de = readdir (md)) != NULL) { - if (de->d_name[0] == '.') - continue; - if (i >= num_maildir_entries) { - if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) - die("not enough memory for %d messages", 2*i+16); - num_maildir_entries = 2*i+16; - } - Maildir[i].filename = concat (cp, "/", de->d_name, NULL); - if (stat(Maildir[i].filename, &ms) != 0) - adios (Maildir[i].filename, "couldn't get delivery time"); - Maildir[i].mtime = ms.st_mtime; - i++; - } - free (cp); - closedir (md); - cp = concat (newmail, "/cur", NULL); - if ((md = opendir(cp)) == NULL) - die("unable to open %s", cp); - while ((de = readdir (md)) != NULL) { - if (de->d_name[0] == '.') - continue; - if (i >= num_maildir_entries) { - if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) - die("not enough memory for %d messages", 2*i+16); - num_maildir_entries = 2*i+16; - } - Maildir[i].filename = concat (cp, "/", de->d_name, NULL); - if (stat(Maildir[i].filename, &ms) != 0) - adios (Maildir[i].filename, "couldn't get delivery time"); - Maildir[i].mtime = ms.st_mtime; - i++; - } - free (cp); - closedir (md); - if (i == 0) - die("no mail to incorporate"); - num_maildir_entries = i; - qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt); - } + if (s1.st_mode & S_IFDIR) { + DIR *md; + struct dirent *de; + struct stat ms; + int i; + i = 0; + cp = concat (newmail, "/new", NULL); + if ((md = opendir(cp)) == NULL) + die("unable to open %s", cp); + while ((de = readdir (md)) != NULL) { + if (de->d_name[0] == '.') + continue; + if (i >= num_maildir_entries) { + if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) + die("not enough memory for %d messages", 2*i+16); + num_maildir_entries = 2*i+16; + } + Maildir[i].filename = concat (cp, "/", de->d_name, NULL); + if (stat(Maildir[i].filename, &ms) != 0) + adios (Maildir[i].filename, "couldn't get delivery time"); + Maildir[i].mtime = ms.st_mtime; + i++; + } + free (cp); + closedir (md); + cp = concat (newmail, "/cur", NULL); + if ((md = opendir(cp)) == NULL) + die("unable to open %s", cp); + while ((de = readdir (md)) != NULL) { + if (de->d_name[0] == '.') + continue; + if (i >= num_maildir_entries) { + if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) + die("not enough memory for %d messages", 2*i+16); + num_maildir_entries = 2*i+16; + } + Maildir[i].filename = concat (cp, "/", de->d_name, NULL); + if (stat(Maildir[i].filename, &ms) != 0) + adios (Maildir[i].filename, "couldn't get delivery time"); + Maildir[i].mtime = ms.st_mtime; + i++; + } + free (cp); + closedir (md); + if (i == 0) + die("no mail to incorporate"); + num_maildir_entries = i; + qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt); + } cp = mh_xstrdup(newmail); newmail = cp; @@ -596,7 +596,7 @@ main (int argc, char **argv) fprintf (aud, "<> %s -ms %s\n", dtimenow(0), from); else { if (host) - fprintf (aud, "<> %s -host %s -user %s\n", dtimenow(0), + fprintf (aud, "<> %s -host %s -user %s\n", dtimenow(0), host, user); else fprintf (aud, "<> %s\n", dtimenow (0)); @@ -655,7 +655,6 @@ main (int argc, char **argv) break; case SCNMSG: - case SCNENC: default: if (aud) fputs (charstring_buffer (scanl), aud); @@ -717,7 +716,6 @@ main (int argc, char **argv) break; case SCNMSG: - case SCNENC: /* * Run the external program hook on the message. */ @@ -761,7 +759,7 @@ main (int argc, char **argv) size_t nrd; if ((sf = fopen (sp, "r")) == NULL) - adios (sp, "unable to read for copy"); + adios (sp, "unable to read for copy"); if ((pf = fopen (cp, "w+")) == NULL) adios (cp, "unable to write for copy"); while ((nrd = fread(buf, 1, sizeof(buf), sf)) > 0) @@ -799,7 +797,6 @@ main (int argc, char **argv) break; case SCNMSG: - case SCNENC: default: /* * Run the external program hook on the message. @@ -877,7 +874,7 @@ main (int argc, char **argv) if (msgnum == hghnum) { inform("no messages incorporated, continuing..."); } else { - /* + /* * Lock the sequence file now, and loop to set the right flags * in the folder structure */