url->user = NULL;
url->pass = NULL;
url->port = 0;
+ url->path = NULL;
#ifdef USE_IMAP
if (account->type == MUTT_ACCT_TYPE_IMAP)
if (option(OPTNEWS))
{
NNTP_SERVER *nserv = CurrentNewsSrv;
- NNTP_DATA *nntp_data = NULL;
regex_t *rx = safe_malloc(sizeof(regex_t));
char *s = buf;
int rc, j = menu->current;
regexec(rx, ff->name, 0, NULL, 0) == 0)
{
if (i == OP_BROWSER_SUBSCRIBE || i == OP_SUBSCRIBE_PATTERN)
- nntp_data = mutt_newsgroup_subscribe(nserv, ff->name);
+ mutt_newsgroup_subscribe(nserv, ff->name);
else
- nntp_data = mutt_newsgroup_unsubscribe(nserv, ff->name);
+ mutt_newsgroup_unsubscribe(nserv, ff->name);
}
if (i == OP_BROWSER_SUBSCRIBE || i == OP_BROWSER_UNSUBSCRIBE)
{
for (k = 0; nserv && k < nserv->groups_num; k++)
{
- nntp_data = nserv->groups_list[k];
+ NNTP_DATA *nntp_data = nserv->groups_list[k];
if (nntp_data && nntp_data->group && !nntp_data->subscribed)
{
if (regexec(rx, nntp_data->group, 0, NULL, 0) == 0)
}
}
if ((p = getenv("NNTPSERVER")))
+ {
+ FREE(&NewsServer);
NewsServer = safe_strdup(p);
+ }
#endif
if ((p = getenv("MAIL")))
}
/* Clear any error message, we're going to try again */
- if (err->data)
- err->data[0] = '\0';
+ err->data[0] = '\0';
bindings = km_get_table(menu[i]);
if (bindings)
{
mutt_set_flag(Context, Context->hdrs[i], MUTT_READ, 0);
}
else
- nntp_data->unread = nntp_data->lastMessage - nntp_data->newsrc_ent[0].last;
+ {
+ nntp_data->unread = nntp_data->lastMessage;
+ if (nntp_data->newsrc_ent)
+ nntp_data->unread -= nntp_data->newsrc_ent[0].last;
+ }
return nntp_data;
}
strfcpy(buf, "POST\r\n", sizeof(buf));
if (nntp_query(nntp_data, buf, sizeof(buf)) < 0)
+ {
+ safe_fclose(&fp);
return -1;
+ }
if (buf[0] != '3')
{
mutt_error(_("Can't post article: %s"), buf);
+ safe_fclose(&fp);
return -1;
}
NNTP_DATA nntp_data;
char buf[LONG_STRING];
struct tm tm;
+ memset(&tm, 0, sizeof(tm));
nntp_data.nserv = nserv;
nntp_data.group = NULL;
void mutt_make_forward_subject(ENVELOPE *env, CONTEXT *ctx, HEADER *cur)
{
+ if (!env)
+ return;
+
char buffer[STRING];
/* set the default subject for the message. */
void mutt_make_misc_reply_headers(ENVELOPE *env, CONTEXT *ctx, HEADER *cur, ENVELOPE *curenv)
{
+ if (!env || !curenv)
+ return;
+
/* This takes precedence over a subject that might have
* been taken from a List-Post header. Is that correct?
*/
static void make_reference_headers(ENVELOPE *curenv, ENVELOPE *env, CONTEXT *ctx)
{
+ if (!env || !ctx)
+ return;
+
env->references = NULL;
env->in_reply_to = NULL;
else
curenv = cur->env;
+ if (!curenv)
+ return -1;
+
if (flags & SENDREPLY)
{
#ifdef USE_NNTP
if ((flags & SENDNEWS))
{
/* in case followup set Newsgroups: with Followup-To: if it present */
- if (!env->newsgroups && curenv &&
- (mutt_strcasecmp(curenv->followup_to, "poster") != 0))
+ if (!env->newsgroups && (mutt_strcasecmp(curenv->followup_to, "poster") != 0))
env->newsgroups = safe_strdup(curenv->followup_to);
}
else
const char *msg, /* file containing message */
int eightbit) /* message contains 8bit chars */
{
- char *ps = NULL, *path = NULL, *s = safe_strdup(Sendmail), *childout = NULL;
+ char *ps = NULL, *path = NULL, *s = NULL, *childout = NULL;
char **args = NULL;
size_t argslen = 0, argsmax = 0;
char **extra_args = NULL;
s = safe_strdup(cmd);
}
+ else
#endif
+ s = safe_strdup(Sendmail);
/* ensure that $sendmail is set to avoid a crash. http://dev.mutt.org/trac/ticket/3548 */
if (!s)