X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fburst.c;h=93fd5e03b8b4b41ca0fb0186f1c7264c228741fa;hb=a8a488a128a8124503d01da632c7290f6abc0752;hp=1f626f358e5c4443674307254e2fc55f304d717b;hpb=a1aa5032943899145617de8d28165556fb2ff2ae;p=mmh diff --git a/uip/burst.c b/uip/burst.c index 1f626f3..93fd5e0 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -8,6 +8,7 @@ */ #include +#include static struct swit switches[] = { #define INPLSW 0 @@ -56,9 +57,10 @@ int main (int argc, char **argv) { int inplace = 0, quietsw = 0, verbosw = 0; - int msgp = 0, hi, msgnum, numburst; + int hi, msgnum, numburst; char *cp, *maildir, *folder = NULL, buf[BUFSIZ]; - char **argp, **arguments, *msgs[MAXARGS]; + char **argp, **arguments; + struct msgs_array msgs = { 0, 0, NULL }; struct smsg *smsgs; struct msgs *mp; @@ -86,10 +88,10 @@ main (int argc, char **argv) snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); - done (1); + done (0); case VERSIONSW: print_version(invo_name); - done (1); + done (0); case INPLSW: inplace++; @@ -119,14 +121,14 @@ main (int argc, char **argv) else folder = pluspath (cp); } else { - msgs[msgp++] = cp; + app_msgarg(&msgs, cp); } } if (!context_find ("path")) free (path ("./", TFOLDER)); - if (!msgp) - msgs[msgp++] = "cur"; + if (!msgs.size) + app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); @@ -143,8 +145,8 @@ main (int argc, char **argv) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ - for (msgnum = 0; msgnum < msgp; msgnum++) - if (!m_convert (mp, msgs[msgnum])) + for (msgnum = 0; msgnum < msgs.size; msgnum++) + if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ @@ -208,7 +210,7 @@ main (int argc, char **argv) static int find_delim (int msgnum, struct smsg *smsgs) { - int wasdlm, msgp; + int wasdlm = 0, msgp; off_t pos; char c, *msgnam; char buffer[BUFSIZ];