The 'return' operator doesn't require its argument to the ()'d.
This has lead to some very inconsistent code.
This commit removes the ()s from return where the argument is a single
token, e.g.
return 42;
return fn(x);
There are ~480 occurrences.
break;
}
- return (src);
+ return src;
}
static void alias_entry (char *s, size_t slen, MUTTMENU *m, int num)
for (; t; t = t->next)
if (mutt_strcasecmp (s, t->name) == 0)
- return (t->addr);
- return (NULL); /* no such alias */
+ return t->addr;
+ return NULL; /* no such alias */
}
static ADDRESS *expand_aliases_r (ADDRESS *a, LIST **expn)
rfc822_qualify (head, fqdn);
}
- return (head);
+ return head;
}
ADDRESS *mutt_expand_aliases (ADDRESS *a)
is_message = mutt_is_message_type(a->type, a->subtype);
if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase(a->hdr->security))
- return (rc);
+ return rc;
use_mailcap = (flag == MUTT_MAILCAP ||
(flag == MUTT_REGULAR && mutt_needs_mailcap (a)));
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
{
mutt_perror ("fopen");
mutt_sleep (2);
- return (-1);
+ return -1;
}
fseeko ((s.fpin = fp), m->offset, 0);
mutt_decode_attachment (m, &s);
{
mutt_perror ("fclose");
mutt_sleep (2);
- return (-1);
+ return -1;
}
}
}
if ((ofp = fopen (m->filename, "r")) == NULL)
{
mutt_perror ("fopen");
- return (-1);
+ return -1;
}
if ((nfp = save_attachment_open (path, flags)) == NULL)
{
mutt_perror ("fopen");
safe_fclose (&ofp);
- return (-1);
+ return -1;
}
if (mutt_copy_stream (ofp, nfp) == -1)
mutt_error (_("Write fault!"));
safe_fclose (&ofp);
safe_fclose (&nfp);
- return (-1);
+ return -1;
}
safe_fclose (&ofp);
if (safe_fsync_close (&nfp) != 0)
{
mutt_error (_("Write fault!"));
- return (-1);
+ return -1;
}
}
if (s.fpout == NULL)
{
mutt_perror ("fopen");
- return (-1);
+ return -1;
}
if (fp == NULL)
{
mutt_perror ("stat");
safe_fclose (&s.fpout);
- return (-1);
+ return -1;
}
if ((s.fpin = fopen (m->filename, "r")) == NULL)
{
mutt_perror ("fopen");
- return (-1);
+ return -1;
}
saved_encoding = m->encoding;
{
mutt_perror ("fopen");
rfc1524_free_entry (&entry);
- return (0);
+ return 0;
}
if ((thepid = mutt_create_filter (command, &fpout, NULL, NULL)) < 0)
unlink(newfile);
rfc1524_free_entry (&entry);
- return (1);
+ return 1;
}
if ((ascii_strcasecmp ("text/plain", type) == 0) ||
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, folder_format_str, data, 0);
- return (src);
+ return src;
}
#ifdef USE_NNTP
}
break;
}
- return (src);
+ return src;
}
#endif /* USE_NNTP */
}
}
mutt_perror (d);
- return (-1);
+ return -1;
}
if (!S_ISDIR (s.st_mode))
{
mutt_error (_("%s is not a directory."), d);
- return (-1);
+ return -1;
}
mutt_buffy_check (0);
if ((dp = opendir (d)) == NULL)
{
mutt_perror (d);
- return (-1);
+ return -1;
}
init_state (state, menu);
BUFFY *tmp = VirtIncoming;
if (!VirtIncoming)
- return (-1);
+ return -1;
mutt_buffy_check (0);
init_state (state, menu);
BUFFY *tmp = Incoming;
if (!Incoming)
- return (-1);
+ return -1;
mutt_buffy_check (0);
init_state (state, menu);
if (!pc)
{
mutt_debug (1, "mutt_get_token: mismatched backticks\n");
- return (-1);
+ return -1;
}
cmd = mutt_substrdup (tok->dptr, pc);
if ((pid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0)
{
mutt_debug (1, "mutt_get_token: unable to fork command: %s\n", cmd);
FREE (&cmd);
- return (-1);
+ return -1;
}
FREE (&cmd);
if (mutt_strncmp ("From ", buffer, 5) == 0)
{
fseek (f, 0, 0);
- return (0);
+ return 0;
}
- return (-1);
+ return -1;
}
/* Return 1 if the last message is new */
int result = 0;
if (fseek_last_message (f) == -1)
- return (0);
+ return 0;
hdr = mutt_new_header ();
tmp_envelope = mutt_read_rfc822_header (f, hdr, 0, 0);
#endif
BuffyDoneTime = BuffyTime;
- return (BuffyCount);
+ return BuffyCount;
}
int mutt_buffy_list (void)
if (!first)
{
mutt_message ("%s", buffylist);
- return (1);
+ return 1;
}
/* there were no mailboxes needing to be notified, so clean up since
* BuffyNotify has somehow gotten out of sync
*/
BuffyNotify = 0;
- return (0);
+ return 0;
}
void mutt_buffy_setnotified (const char *path)
{
return (mutt_buffy_list ());
}
- return (0);
+ return 0;
}
/*
p->fg = p->bg = -1;
- return (p);
+ return p;
}
static void free_color_line(COLOR_LINE **l,
}
/* check to see if there are colors left */
- if (++UserColors > COLOR_PAIRS) return (A_NORMAL);
+ if (++UserColors > COLOR_PAIRS) return A_NORMAL;
/* find the smallest available index (object) */
i = 1;
(*col >= COLORS && !option(OPTNOCURSES) && has_colors()))
{
snprintf (err->data, err->dsize, _("%s: color not supported by term"), s);
- return (-1);
+ return -1;
}
}
else if ((*col = mutt_getvaluebyname (s, Colors)) == -1)
{
snprintf (err->data, err->dsize, _("%s: no such color"), s);
- return (-1);
+ return -1;
}
if (is_bright)
if ((object = mutt_getvaluebyname (buf->data, Fields)) == -1)
{
snprintf (err->data, err->dsize, _("%s: no such object"), buf->data);
- return (-1);
+ return -1;
}
if (object > MT_COLOR_INDEX_SUBJECT) { /* uncolor index column */
snprintf (err->data, err->dsize,
_("%s: command valid only for index, body, header objects"),
parse_uncolor ? "uncolor" : "unmono");
- return (-1);
+ return -1;
}
if (!MoreArgs (s))
{
snprintf (err->data, err->dsize,
_("%s: too few arguments"), parse_uncolor ? "uncolor" : "unmono");
- return (-1);
+ return -1;
}
if(
for (i = 0; Context && i < Context->msgcount; i++)
Context->hdrs[i]->pair = 0;
}
- return (0);
+ return 0;
}
#ifdef HAVE_COLOR
{
regerror (r, &tmp->rx, err->data, err->dsize);
free_color_line(&tmp, 1);
- return (-1);
+ return -1;
}
tmp->next = *top;
tmp->pattern = safe_strdup (s);
else if ((*o = mutt_getvaluebyname (buf->data, Fields)) == -1)
{
snprintf (err->data, err->dsize, _("%s: no such object"), buf->data);
- return (-1);
+ return -1;
}
return 0;
if (! MoreArgs (s))
{
strfcpy (err->data, _("color: too few arguments"), err->dsize);
- return (-1);
+ return -1;
}
mutt_extract_token (buf, s, 0);
if (parse_color_name (buf->data, fg, attr, 1, err) != 0)
- return (-1);
+ return -1;
if (! MoreArgs (s))
{
strfcpy (err->data, _("color: too few arguments"), err->dsize);
- return (-1);
+ return -1;
}
mutt_extract_token (buf, s, 0);
if (parse_color_name (buf->data, bg, attr, 0, err) != 0)
- return (-1);
+ return -1;
return 0;
}
if (! MoreArgs (s))
{
strfcpy (err->data, _("mono: too few arguments"), err->dsize);
- return (-1);
+ return -1;
}
mutt_extract_token (buf, s, 0);
else
{
snprintf (err->data, err->dsize, _("%s: no such attribute"), buf->data);
- return (-1);
+ return -1;
}
return 0;
if (MoreArgs (s) && (object != MT_COLOR_STATUS))
{
strfcpy (err->data, _("too many arguments"), err->dsize);
- return (-1);
+ return -1;
}
/* dry run? */
&& use_default_colors () != OK)
{
strfcpy (err->data, _("default colors not supported"), err->dsize);
- return (-1);
+ return -1;
}
# endif /* HAVE_USE_DEFAULT_COLORS */
#endif
set_option (OPTFORCEREDRAWINDEX);
}
- return (r);
+ return r;
}
#ifdef HAVE_COLOR
if ((fpout = safe_fopen (tempfile, "w")) == NULL)
{
mutt_error (_("Could not create temporary file!"));
- return (0);
+ return 0;
}
if (DisplayFilter && *DisplayFilter)
mutt_pretty_mailbox (buf, sizeof (buf));
if (mutt_enter_fname (prompt, buf, sizeof (buf), redraw, 0) == -1)
- return (-1);
+ return -1;
if (*redraw != REDRAW_FULL)
{
}
if (!buf[0])
- return (-1);
+ return -1;
/* This is an undocumented feature of ELM pointed out to me by Felix von
* Leitner <leitner@prz.fu-berlin.de>
mutt_buffy_cleanup (buf, &st);
mutt_clear_error ();
- return (0);
+ return 0;
}
return -1;
{
mutt_debug (1, "mutt_complete(): %s: %s (errno %d).\n",
exp_dirpart, strerror (errno), errno);
- return (-1);
+ return -1;
}
/*
if (option (OPTNEEDREDRAW))
{
unset_option (OPTNEEDREDRAW);
- return (REDRAW_FULL);
+ return REDRAW_FULL;
}
if (mutt_addrlist_to_intl (*addr, &err) != 0)
{
mutt_error (_("You may not delete the only attachment."));
idx[x]->content->tagged = 0;
- return (-1);
+ return -1;
}
for (y = 0; y < *idxlen; y++)
idx[*idxlen - 1] = NULL;
menu->max = --(*idxlen);
- return (0);
+ return 0;
}
static void update_idx (MUTTMENU *menu, ATTACHPTR **idx, short idxlen)
case 0:
*buf = 0;
- return (src);
+ return src;
default:
snprintf (buf, buflen, "%%%s%c", prefix, op);
else if (flags & MUTT_FORMAT_OPTIONAL)
compose_status_line (buf, buflen, col, cols, menu, elsestring);
- return (src);
+ return src;
}
static void compose_status_line (char *buf, size_t buflen, size_t col, int cols,
FREE (&idx);
- return (r);
+ return r;
}
}
if (!ignore && fputs (buf, out) == EOF)
- return (-1);
+ return -1;
}
return 0;
}
FREE (&headers);
if (error)
- return (-1);
- return (0);
+ return -1;
+ return 0;
}
/* flags
hdr->content->type == TYPEMULTIPART)
{
if (crypt_pgp_decrypt_mime (fpin, &fp, hdr->content, &cur))
- return (-1);
+ return -1;
fputs ("MIME-Version: 1.0\n", fpout);
}
&& hdr->content->type == TYPEAPPLICATION)
{
if (crypt_smime_decrypt_mime (fpin, &fp, hdr->content, &cur))
- return (-1);
+ return -1;
}
if (!cur)
{
safe_fclose (&fp);
mutt_free_body (&cur);
- return (-1);
+ return -1;
}
mutt_free_body (&cur);
safe_fclose (&fp);
if ((decoded_fp = safe_fopen (tempfile, "w+")) == NULL)
{
mutt_perror (tempfile);
- return (-1);
+ return -1;
}
unlink (tempfile);
mutt_FormatString (dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
- return (src);
+ return src;
}
/* Used by the display function to format a line. */
mutt_free_list (&crypt_hook_list);
}
- return (keylist);
+ return keylist;
}
char *pgp_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode)
}
}
- return (msg->security);
+ return msg->security;
}
int pgp_gpgme_send_menu (HEADER *msg, int *redraw)
return 0;
if ((msg->security & SIGN) && !crypt_valid_passphrase (msg->security))
- return (-1);
+ return -1;
if ((WithCrypto & APPLICATION_PGP) && ((msg->security & PGPINLINE) == PGPINLINE))
{
if (!tmp_pbody)
{
/* signed ? free it! */
- return (-1);
+ return -1;
}
/* free tmp_body if messages was signed AND encrypted ... */
if (tmp_smime_pbody != msg->content && tmp_smime_pbody != tmp_pbody)
mutt_free_body (&tmp_pgp_pbody->next);
}
- return (-1);
+ return -1;
}
/* destroy temporary signature envelope when doing retainable
if ((*keylist = crypt_pgp_findkeys (adrlist, oppenc_mode)) == NULL)
{
rfc822_free_address (&adrlist);
- return (-1);
+ return -1;
}
unset_option (OPTPGPCHECKTRUST);
}
if ((*keylist = crypt_smime_findkeys (adrlist, oppenc_mode)) == NULL)
{
rfc822_free_address (&adrlist);
- return (-1);
+ return -1;
}
}
}
rfc822_free_address (&adrlist);
- return (0);
+ return 0;
}
event_t timeout = {-2, OP_NULL};
if (UngetCount)
- return (UngetKeyEvents[--UngetCount]);
+ return UngetKeyEvents[--UngetCount];
if (!option(OPTIGNOREMACROEVENTS) && MacroBufferCount)
- return (MacroEvents[--MacroBufferCount]);
+ return MacroEvents[--MacroBufferCount];
SigInt = 0;
mutt_window_clearline (MuttMessageWindow, 0);
mutt_free_enter_state (&es);
- return (ret);
+ return ret;
}
int mutt_get_field_unbuffered (char *msg, char *buf, size_t buflen, int flags)
rc = mutt_get_field (msg, buf, buflen, flags);
unset_option (OPTIGNOREMACROEVENTS);
- return (rc);
+ return rc;
}
void mutt_clear_error (void)
* mutt_message() so it isn't displayed when the screen is refreshed. */
mutt_clear_error();
}
- return (def);
+ return def;
}
/* this function is called when the user presses the abort key */
close (f);
fputs ("\r\n", stdout);
mutt_clear_error ();
- return (ch);
+ return ch;
}
int mutt_do_pager (const char *banner,
if (ch.ch < 0)
{
mutt_window_clearline (MuttMessageWindow, 0);
- return (-1);
+ return -1;
}
else if (ch.ch == '?')
{
for (i=msgno+1; i < Context->vcount; i++)
if (! Context->hdrs[Context->v2r[i]]->deleted)
- return (i);
- return (-1);
+ return i;
+ return -1;
}
static int ci_previous_undeleted (int msgno)
for (i=msgno-1; i>=0; i--)
if (! Context->hdrs[Context->v2r[i]]->deleted)
- return (i);
- return (-1);
+ return i;
+ return -1;
}
/* Return the index of the first new message, or failing that, the first
! Context->hdrs[Context->v2r[i]]->deleted)
{
if (! Context->hdrs[Context->v2r[i]]->old)
- return (i);
+ return i;
else if (old == -1)
old = i;
}
}
if (old != -1)
- return (old);
+ return old;
/* If Sort is reverse and not threaded, the latest message is first.
* If Sort is threaded, the latest message is first iff exactly one
}
mutt_menu_destroy (&menu);
- return (close);
+ return close;
}
void mutt_set_header_color (CONTEXT *ctx, HEADER *curhdr)
if (local)
g -= compute_tz (g, t);
- return (g);
+ return g;
}
/* Return 1 if month is February of leap year, else 0 */
int y = tm->tm_year + 1900;
return (((y & 3) == 0) && (((y % 100) != 0) || ((y % 400) == 0)));
}
- return (0);
+ return 0;
}
void mutt_normalize_time (struct tm *tm)
safe_realloc (&buf, sizeof (char *) * (++*bufmax));
}
if (buf) buf[*buflen] = NULL;
- return (buf);
+ return buf;
}
static char **
snprintf(tmp, sizeof(tmp), "%s: %s\n", path, strerror(errno));
addstr(tmp);
}
- return (buf);
+ return buf;
}
static int be_barf_file (const char *path, char **buf, int buflen)
{
addstr (strerror (errno));
addch ('\n');
- return (-1);
+ return -1;
}
for (i = 0; i < buflen; i++) fputs (buf[i], f);
if (fclose (f) == 0) return 0;
printw ("fclose: %s\n", strerror (errno));
- return (-1);
+ return -1;
}
static void be_free_memory (char **buf, int buflen)
printw (_("%d: invalid message number.\n"), n);
msg = NULL;
}
- return (buf);
+ return buf;
}
static void be_print_header (ENVELOPE *env)
{
*in = 0;
if (pipe (pin) == -1)
- return (-1);
+ return -1;
}
if (out)
close (pin[0]);
close (pin[1]);
}
- return (-1);
+ return -1;
}
}
close (pout[0]);
close (pout[1]);
}
- return (-1);
+ return -1;
}
}
close (perr[1]);
}
- return (-1);
+ return -1;
}
if (out)
*err = fdopen (perr[0], "r");
}
- return (thepid);
+ return thepid;
}
pid_t mutt_create_filter (const char *s, FILE **in, FILE **out, FILE **err)
if ((Sort & SORT_MASK) != SORT_THREADS)
{
mutt_error (_("Threading is not enabled."));
- return (-1);
+ return -1;
}
if (!subthread)
mutt_set_flag (Context, cur->message, flag, bf);
if ((cur = cur->child) == NULL)
- return (0);
+ return 0;
while (true)
{
{
cur = cur->parent;
if (cur == start)
- return (0);
+ return 0;
}
cur = cur->next;
}
if (i < 0)
{
mutt_window_clearline (MuttMessageWindow, 0);
- return (-1);
+ return -1;
}
mutt_window_clearline (MuttMessageWindow, 0);
default:
BEEP ();
- return (-1);
+ return -1;
}
if (h)
for (i = 0; i < 12; i++)
if (mutt_strncasecmp (s, Months[i], 3) == 0)
- return (i);
- return (-1); /* error */
+ return i;
+ return -1; /* error */
}
static int is_day_name (const char *s)
if ((p = getenv ("MM_NOASK")) != NULL && *p)
{
if (mutt_strcmp (p, "1") == 0)
- return (1);
+ return 1;
strfcpy (tmp, p, sizeof (tmp));
p = tmp;
if (*(q+1) == '*')
{
if (ascii_strncasecmp (buf, p, q-p) == 0)
- return (1);
+ return 1;
}
else
{
if (ascii_strcasecmp (buf, p) == 0)
- return (1);
+ return 1;
}
}
else
{
lng = mutt_strlen (p);
if (buf[lng] == '/' && (mutt_strncasecmp (buf, p, lng) == 0))
- return (1);
+ return 1;
}
p = NULL;
}
}
- return (0);
+ return 0;
}
/*
if (is_autoview (a))
return 1;
else if (a->type == TYPETEXT)
- return (1);
+ return 1;
else if (a->type == TYPEMESSAGE)
- return (1);
+ return 1;
else if (a->type == TYPEMULTIPART)
{
BODY *p = NULL;
{
if ((ascii_strcasecmp (a->subtype, "signed") == 0) ||
(ascii_strcasecmp (a->subtype, "encrypted") == 0))
- return (1);
+ return 1;
}
for (p = a->parts; p; p = p->next)
{
if (mutt_can_decode (p))
- return (1);
+ return 1;
}
}
else if (WithCrypto && a->type == TYPEAPPLICATION)
{
if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(a))
- return (1);
+ return 1;
if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(a))
- return (1);
+ return 1;
}
- return (0);
+ return 0;
}
static int multipart_handler (BODY *a, STATE *s)
if (r == 0)
{
FREE (&ptr);
- return (-1);
+ return -1;
}
if (r > 0)
break;
for (; ptr; ptr = ptr->next)
{
if (table->cmp_key (key, ptr->key) == 0)
- return (ptr);
+ return ptr;
}
return NULL;
}
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, hdr_format_str, (unsigned long) hfi, flags);
- return (src);
+ return src;
#undef THREAD_NEW
#undef THREAD_OLD
}
return (&map[i]);
}
- return (NULL);
+ return NULL;
}
void mutt_make_help (char *d, size_t dlen, const char *txt, int menu, int op)
{
snprintf (fmt, sizeof(fmt), "%%-%ds", i - col);
fprintf (f, fmt, "");
- return (i);
+ return i;
}
fputc (' ', f);
return (col + 1);
struct history *h = GET_HISTORY(hclass);
if (!HistSize || !h)
- return (""); /* disabled */
+ return ""; /* disabled */
next = h->cur + 1;
if (next > HistSize)
struct history *h = GET_HISTORY(hclass);
if (!HistSize || !h)
- return (""); /* disabled */
+ return ""; /* disabled */
prev = h->cur - 1;
if (prev < 0)
if (~data & MUTT_GLOBALHOOK) /* NOT a global hook */
FREE (&pattern.data);
FREE (&command.data);
- return (-1);
+ return -1;
}
static void delete_hook (HOOK *h)
{
snprintf (err->data, err->dsize,
_("unhook: unknown hook type: %s"), buf->data);
- return (-1);
+ return -1;
}
if (current_hook_type == type)
{
if (tmp->type & type)
{
if (regexec (tmp->rx.rx, pat, 0, NULL, 0) == 0)
- return (tmp->command);
+ return tmp->command;
}
- return (NULL);
+ return NULL;
}
void mutt_message_hook (CONTEXT *ctx, HEADER *hdr, int type)
{
if ((tmp->type & hook) && ((match &&
regexec (tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not))
- return (tmp->command);
+ return tmp->command;
}
- return (NULL);
+ return NULL;
}
static LIST *_mutt_list_hook (const char *match, int hook)
((match && regexec (tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not))
matches = mutt_add_list (matches, tmp->command);
}
- return (matches);
+ return matches;
}
char *mutt_charset_hook (const char *chs)
if ((msg->fp = safe_fopen (tmp, "w")) == NULL)
{
mutt_perror (tmp);
- return (-1);
+ return -1;
}
msg->path = safe_strdup(tmp);
return 0;
{ \
snprintf (err->data, err->dsize, \
_("Not available in this menu.")); \
- return (-1); \
+ return -1; \
}
typedef struct myvar
{
case MUTT_YES:
case MUTT_NO:
- return (v);
+ return v;
default:
v = mutt_yesorno (prompt, (v == MUTT_ASKYES));
mutt_window_clearline (MuttMessageWindow, 0);
- return (v);
+ return v;
}
/* not reached */
for (i = 0; MuttVars[i].option; i++)
if (mutt_strcmp (s, MuttVars[i].option) == 0)
return (MuttVars[i].type == DT_SYN ? mutt_option_index ((char *) MuttVars[i].data) : i);
- return (-1);
+ return -1;
}
#ifdef USE_LUA
if ((i = mutt_getvaluebyname (s, map)) == -1)
{
snprintf (err->data, err->dsize, _("%s: unknown sorting method"), s);
- return (-1);
+ return -1;
}
*val = i | flags;
if (!MoreArgs (s))
{
strfcpy (err->data, _("alias: no address"), err->dsize);
- return (-1);
+ return -1;
}
mutt_extract_token (buf, s, 0);
if ((p = strpbrk (buf->data, ": \t")) == NULL || *p != ':')
{
strfcpy (err->data, _("invalid header field"), err->dsize);
- return (-1);
+ return -1;
}
keylen = p - buf->data + 1;
!(reset && (mutt_strcmp ("all", tmp->data) == 0)))
{
snprintf (err->data, err->dsize, _("%s: unknown variable"), tmp->data);
- return (-1);
+ return -1;
}
SKIPWS (s->dptr);
if (query || unset || inv)
{
snprintf (err->data, err->dsize, _("prefix is illegal with reset"));
- return (-1);
+ return -1;
}
if (s && *s->dptr == '=')
{
snprintf (err->data, err->dsize, _("value is illegal with reset"));
- return (-1);
+ return -1;
}
if (mutt_strcmp ("all", tmp->data) == 0)
if (CurrentMenu == MENU_PAGER)
{
snprintf (err->data, err->dsize, _("Not available in this menu."));
- return (-1);
+ return -1;
}
for (idx = 0; MuttVars[idx].option; idx++)
restore_default (&MuttVars[idx]);
if (unset || inv || query)
{
snprintf (err->data, err->dsize, _("Usage: set variable=yes|no"));
- return (-1);
+ return -1;
}
s->dptr++;
else
{
snprintf (err->data, err->dsize, _("Usage: set variable=yes|no"));
- return (-1);
+ return -1;
}
}
else
{
snprintf (err->data, err->dsize, _("%s: unknown variable"), myvar);
- return (-1);
+ return -1;
}
}
else if (DTYPE (MuttVars[idx].type) == DT_ADDR)
{
snprintf (err->data, err->dsize, _("Invalid value for option %s: \"%s\""),
MuttVars[idx].option, tmp->data);
- return (-1);
+ return -1;
}
FREE ((void *) MuttVars[idx].data); /* __FREE_CHECKED__ */
#endif
}
}
- return (r);
+ return r;
}
/* Stack structure
if (!to_absolute_path(rcfile, mutt_front_list(MuttrcStack)))
{
mutt_error("Error: impossible to build path of '%s'.", rcfile_path);
- return (-1);
+ return -1;
}
if (!MuttrcStack || mutt_find_list(MuttrcStack, rcfile) == NULL)
else
{
mutt_error("Error: Cyclic sourcing of configuration file '%s'.", rcfile);
- return (-1);
+ return -1;
}
}
if ((f = mutt_open_read (rcfile, &pid)) == NULL)
{
snprintf (err->data, err->dsize, "%s: %s", rcfile, strerror (errno));
- return (-1);
+ return -1;
}
mutt_buffer_init (&token);
mutt_pop_list(&MuttrcStack);
- return (rc);
+ return rc;
}
#undef MAXERRS
if (mutt_extract_token (tmp, s, 0) != 0)
{
snprintf (err->data, err->dsize, _("source: error at %s"), s->dptr);
- return (-1);
+ return -1;
}
if (MoreArgs (s))
{
strfcpy (err->data, _("source: too many arguments"), err->dsize);
- return (-1);
+ return -1;
}
strfcpy (path, tmp->data, sizeof (path));
mutt_expand_path (path, sizeof (path));
for (i=0; map[i].name; i++)
if (map[i].value == val)
- return (map[i].name);
+ return map[i].name;
return NULL;
}
for (i = 0; map[i].name; i++)
if (ascii_strcasecmp (map[i].name, name) == 0)
- return (map[i].value);
- return (-1);
+ return map[i].value;
+ return -1;
}
#ifdef DEBUG
p->len = len;
p->keys = safe_malloc (len * sizeof (keycode_t));
memcpy (p->keys, keys, len * sizeof (keycode_t));
- return (p);
+ return p;
}
static int parse_fkey(char *s)
snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
else
snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
- return (buf);
+ return buf;
}
int km_expand_key (char *s, size_t len, struct keymap_t *map)
int p = 0;
if (!map)
- return (0);
+ return 0;
while (true)
{
len -= (l = mutt_strlen (s));
if (++p >= map->len || !len)
- return (1);
+ return 1;
s += l;
}
for (; map; map = map->next)
if (map->op == func)
break;
- return (map);
+ return map;
}
#ifdef NCURSES_VERSION
}
else
tokenize_push_macro_string (buf->data);
- return (r);
+ return r;
}
/* expects to see: <menu-string>,<menu-string>,... <key-string> */
strfcpy (err->data, _("null key sequence"), err->dsize);
}
else if (MoreArgs (s))
- return (buf.data);
+ return buf.data;
}
else
{
}
error:
FREE (&buf.data);
- return (NULL);
+ return NULL;
}
static int
if (mutt_strcmp (func, bindings[i].name) == 0)
{
km_bindkey (key, menu, bindings[i].op);
- return (0);
+ return 0;
}
- return (-1);
+ return -1;
}
const struct binding_t *km_get_table (int menu)
if ((key = parse_keymap (menu, s, sizeof (menu)/sizeof (menu[0]),
&nummenus, err)) == NULL)
- return (-1);
+ return -1;
/* function to execute */
mutt_extract_token (buf, s, 0);
}
}
FREE (&key);
- return (r);
+ return r;
}
/* macro <menu> <key> <macro> <description> */
char *key = NULL;
if ((key = parse_keymap (menu, s, sizeof (menu) / sizeof (menu[0]), &nummenus, err)) == NULL)
- return (-1);
+ return -1;
mutt_extract_token (buf, s, MUTT_TOKEN_CONDENSE);
/* make sure the macro sequence is not an empty string */
}
}
FREE (&key);
- return (r);
+ return r;
}
/* exec function-name */
if (!MoreArgs (s))
{
strfcpy (err->data, _("exec: no arguments"), err->dsize);
- return (-1);
+ return -1;
}
do
{
mutt_flushinp ();
mutt_error (_("%s: no such function"), function);
- return (-1);
+ return -1;
}
nops++;
}
sleep (1);
mutt_exit (1);
}
- return (p);
+ return p;
}
void safe_realloc (void *ptr, size_t siz)
l = strlen (s) + 1;
p = safe_malloc (l);
memcpy (p, s, l);
- return (p);
+ return p;
}
char *safe_strcat (char *d, size_t l, const char *s)
p++;
}
- return (s);
+ return s;
}
/**
break;
if (fwrite (buf, 1, chunk, out) != chunk)
{
- return (-1);
+ return -1;
}
size -= chunk;
}
while ((l = fread (buf, 1, sizeof (buf), fin)) > 0)
{
if (fwrite (buf, 1, l, fout) != l)
- return (-1);
+ return -1;
}
if (fflush(fout) != 0) return -1;
compare_stat(&osb, &nsb) == -1)
{
close (fd);
- return (-1);
+ return -1;
}
- return (fd);
+ return fd;
}
/* when opening files for writing, make sure the file doesn't already exist
flags |= O_WRONLY;
if ((fd = safe_open (path, flags)) < 0)
- return (NULL);
+ return NULL;
return (fdopen (fd, mode));
}
if (!haystack)
return NULL;
if (!needle)
- return (haystack);
+ return haystack;
while (*(p = haystack))
{
p++, q++)
;
if (!*q)
- return (haystack);
+ return haystack;
haystack++;
}
return NULL;
return 0;
}
- return (r);
+ return r;
}
static void mbox_unlock_mailbox (CONTEXT *ctx)
if (stat (ctx->path, &sb) == -1)
{
mutt_perror (ctx->path);
- return (-1);
+ return -1;
}
ctx->atime = sb.st_atime;
ctx->mtime = sb.st_mtime;
{
mutt_debug (1, "mmdf_parse_mailbox: fseek() failed\n");
mutt_error (_("Mailbox is corrupt!"));
- return (-1);
+ return -1;
}
}
else
{
mutt_debug (1, "mmdf_parse_mailbox: corrupt mailbox!\n");
mutt_error (_("Mailbox is corrupt!"));
- return (-1);
+ return -1;
}
}
if (stat (ctx->path, &sb) == -1)
{
mutt_perror (ctx->path);
- return (-1);
+ return -1;
}
ctx->size = sb.st_size;
if ((ctx->fp = fopen (ctx->path, "r")) == NULL)
{
mutt_perror (ctx->path);
- return (-1);
+ return -1;
}
mutt_block_signals ();
if (mbox_lock_mailbox (ctx, 0, 1) == -1)
{
mutt_unblock_signals ();
- return (-1);
+ return -1;
}
if (ctx->magic == MUTT_MBOX)
mbox_unlock_mailbox (ctx);
mutt_unblock_signals ();
- return (rc);
+ return rc;
}
static int mbox_open_mailbox_append (CONTEXT *ctx, int flags)
{
if ((mutt_strcmp (a->mailbox, b->mailbox) != 0) ||
(mutt_strcmp (a->personal, b->personal) != 0))
- return (0);
+ return 0;
a = a->next;
b = b->next;
}
if (a || b)
- return (0);
+ return 0;
- return (1);
+ return 1;
}
static int strict_cmp_lists (const LIST *a, const LIST *b)
while (a && b)
{
if (mutt_strcmp (a->data, b->data) != 0)
- return (0);
+ return 0;
a = a->next;
b = b->next;
}
if (a || b)
- return (0);
+ return 0;
- return (1);
+ return 1;
}
static int strict_cmp_envelopes (const ENVELOPE *e1, const ENVELOPE *e2)
!strict_addrcmp (e1->to, e2->to) ||
!strict_addrcmp (e1->cc, e2->cc) ||
!strict_addrcmp (e1->return_path, e2->return_path))
- return (0);
+ return 0;
else
- return (1);
+ return 1;
}
else
{
if (e1 == NULL && e2 == NULL)
- return (1);
+ return 1;
else
- return (0);
+ return 0;
}
}
{
if ((mutt_strcmp (p1->attribute, p2->attribute) != 0) ||
(mutt_strcmp (p1->value, p2->value) != 0))
- return (0);
+ return 0;
p1 = p1->next;
p2 = p2->next;
}
if (p1 || p2)
- return (0);
+ return 0;
- return (1);
+ return 1;
}
static int strict_cmp_bodies (const BODY *b1, const BODY *b2)
(mutt_strcmp (b1->description, b2->description) != 0) ||
!strict_cmp_parameters (b1->parameter, b2->parameter) ||
b1->length != b2->length)
- return (0);
- return (1);
+ return 0;
+ return 1;
}
/* return 1 if headers are strictly identical */
h1->mime != h2->mime ||
!strict_cmp_envelopes (h1->env, h2->env) ||
!strict_cmp_bodies (h1->content, h2->content))
- return (0);
+ return 0;
else
- return (1);
+ return 1;
}
else
{
if (h1 == NULL && h2 == NULL)
- return (1);
+ return 1;
else
- return (0);
+ return 0;
}
}
FREE (&old_hdrs);
ctx->quiet = 0;
- return (-1);
+ return -1;
}
mutt_touch_atime (fileno (ctx->fp));
if (stat (ctx->path, &st) == 0)
{
if (st.st_mtime == ctx->mtime && st.st_size == ctx->size)
- return (0);
+ return 0;
if (st.st_size == ctx->size)
{
/* the file was touched, but it is still the same length, so just exit */
ctx->mtime = st.st_mtime;
- return (0);
+ return 0;
}
if (st.st_size > ctx->size)
* probably the new mail arrived: no reason to wait till we can
* parse it: we'll get it on the next pass
*/
- return (MUTT_LOCKED);
+ return MUTT_LOCKED;
}
unlock = 1;
}
mutt_unblock_signals ();
}
- return (MUTT_NEW_MAIL); /* signal that new mail arrived */
+ return MUTT_NEW_MAIL; /* signal that new mail arrived */
}
else
modified = 1;
mbox_unlock_mailbox (ctx);
mutt_unblock_signals ();
}
- return (MUTT_REOPENED);
+ return MUTT_REOPENED;
}
}
mx_fastclose_mailbox (ctx);
mutt_unblock_signals ();
mutt_error (_("Mailbox was corrupted!"));
- return (-1);
+ return -1;
}
/*
{
mx_fastclose_mailbox (ctx);
mutt_error (_("Fatal error! Could not reopen mailbox!"));
- return (-1);
+ return -1;
}
mutt_block_signals ();
}
else if (i < 0)
/* fatal error */
- return (-1);
+ return -1;
/* Create a temporary file to write the new version of the mailbox in. */
mutt_mktemp (tempfile, sizeof (tempfile));
mutt_sleep (5);
FREE (&newOffset);
FREE (&oldOffset);
- return (-1);
+ return -1;
}
if (fseeko (ctx->fp, offset, SEEK_SET) != 0 || /* seek the append location */
mutt_sleep (5);
FREE (&newOffset);
FREE (&oldOffset);
- return (-1);
+ return -1;
}
/* Restore the previous access/modification times */
mutt_error (_("Fatal error! Could not reopen mailbox!"));
FREE (&newOffset);
FREE (&oldOffset);
- return (-1);
+ return -1;
}
/* update the offsets of the rewritten messages */
mutt_update_mailbox (tmp);
}
- return (0); /* signal success */
+ return 0; /* signal success */
bail: /* Come here in case of disaster */
{
mutt_error (_("Could not reopen mailbox!"));
mx_fastclose_mailbox (ctx);
- return (-1);
+ return -1;
}
if (need_sort)
p->messagewin = MuttMessageWindow;
p->color = default_color;
p->search = menu_search_generic;
- return (p);
+ return p;
}
void mutt_menu_destroy (MUTTMENU **p)
if (mutt_get_field ((op == OP_SEARCH || op == OP_SEARCH_NEXT)
? _("Search for: ") : _("Reverse search for: "),
buf, sizeof (buf), MUTT_CLEAR) != 0 || !buf[0])
- return (-1);
+ return -1;
if (menu->menu >= 0 && menu->menu < MENU_MAX)
{
mutt_str_replace (&SearchBuffers[menu->menu], buf);
{
regerror (r, &re, buf, sizeof (buf));
mutt_error ("%s", buf);
- return (-1);
+ return -1;
}
r = menu->current + searchDir;
}
regfree (&re);
mutt_error (_("Not found."));
- return (-1);
+ return -1;
}
static int menu_dialog_translate_op (int i)
{
menu_redraw_full (menu);
/* allow the caller to do any local configuration */
- return (OP_REDRAW);
+ return OP_REDRAW;
}
if (!menu->dialog)
default:
if (menu->is_mailbox_list)
last_position = menu->current;
- return (i);
+ return i;
}
}
/* not reached */
FREE (tgt); /* __FREE_CHECKED__ */
close (fd);
unlink (path);
- return (-1);
+ return -1;
}
return 0;
* of the main folder path from which to read messages
*/
if (mh_read_dir (ctx, "new") == -1 || mh_read_dir (ctx, "cur") == -1)
- return (-1);
+ return -1;
return 0;
}
if (mkdir (ctx->path, S_IRWXU))
{
mutt_perror (ctx->path);
- return (-1);
+ return -1;
}
snprintf (tmp, sizeof (tmp), "%s/cur", ctx->path);
{
mutt_perror (tmp);
rmdir (ctx->path);
- return (-1);
+ return -1;
}
snprintf (tmp, sizeof (tmp), "%s/new", ctx->path);
snprintf (tmp, sizeof (tmp), "%s/cur", ctx->path);
rmdir (tmp);
rmdir (ctx->path);
- return (-1);
+ return -1;
}
snprintf (tmp, sizeof (tmp), "%s/tmp", ctx->path);
snprintf (tmp, sizeof (tmp), "%s/new", ctx->path);
rmdir (tmp);
rmdir (ctx->path);
- return (-1);
+ return -1;
}
}
if (mkdir (ctx->path, S_IRWXU))
{
mutt_perror (ctx->path);
- return (-1);
+ return -1;
}
snprintf (tmp, sizeof (tmp), "%s/.mh_sequences", ctx->path);
{
mutt_perror (tmp);
rmdir (ctx->path);
- return (-1);
+ return -1;
}
close (i);
}
FREE (&msg->path);
close (fd);
unlink (path);
- return (-1);
+ return -1;
}
return 0;
if ((dirp = opendir (ctx->path)) == NULL)
{
mutt_perror (ctx->path);
- return (-1);
+ return -1;
}
/* figure out what the next message number is */
{
/* when doing attachment deletion/rethreading, fall back to the MH case. */
if (mh_rewrite_message (ctx, msgno) != 0)
- return (-1);
+ return -1;
}
else
{
{
mutt_debug (1, "maildir_sync_message: %s: unable to find subdir!\n",
h->path);
- return (-1);
+ return -1;
}
p++;
strfcpy (newpath, p, sizeof (newpath));
if (rename (oldpath, fullpath) != 0)
{
mutt_perror ("rename");
- return (-1);
+ return -1;
}
mutt_str_replace (&h->path, partpath);
}
- return (0);
+ return 0;
}
#ifdef USE_HCACHE
if (mutt_extract_token(tmp, s, 0) != 0)
{
snprintf(err->data, err->dsize, _("source: error at %s"), s->dptr);
- return (-1);
+ return -1;
}
if (MoreArgs(s))
{
strfcpy(err->data, _("source: too many arguments"), err->dsize);
- return (-1);
+ return -1;
}
strfcpy(path, tmp->data, sizeof(path));
mutt_expand_path(path, sizeof(path));
else
strfcpy (s, _("[invalid date]"), len);
- return (s);
+ return s;
}
/*
p->disposition = DISPATTACH;
p->use_disp = 1;
- return (p);
+ return p;
}
}
}
}
- return (rv);
+ return rv;
}
void mutt_free_list (LIST **list)
else
l = r = t;
}
- return (l);
+ return l;
}
void mutt_free_header (HEADER **h)
imap_expand_path (s, slen);
#endif
- return (s);
+ return s;
}
/* Extract the real name from /etc/passwd's GECOS field.
{
for (; p; p = p->next)
if (ascii_strcasecmp (s, p->attribute) == 0)
- return (p->value);
+ return p->value;
return NULL;
}
strfcpy (tmp, mutt_basename (NONULL (attname)), sizeof (tmp));
if (mutt_get_field (_("File under directory: "), tmp, sizeof (tmp),
MUTT_FILE | MUTT_CLEAR) != 0 || !tmp[0])
- return (-1);
+ return -1;
mutt_concat_path (fname, path, tmp, flen);
}
else
{
if (stat (path, &s) < 0)
- return (NULL);
+ return NULL;
if (S_ISDIR (s.st_mode))
{
errno = EINVAL;
- return (NULL);
+ return NULL;
}
f = fopen (path, "r");
*thepid = -1;
}
- return (f);
+ return f;
}
/* returns 0 if OK to proceed, -1 to abort, 1 to retry */
}
mutt_window_clearline (MuttMessageWindow, 0);
- return (ret);
+ return ret;
}
void state_prefix_putc (char c, STATE *s)
{
mutt_debug (1, "mx_get_magic(): unable to stat %s: %s (errno %d).\n",
path, strerror (errno), errno);
- return (-1);
+ return -1;
}
if (S_ISDIR (st.st_mode))
{
/* hard to tell what zero-length files are, so assume the default magic */
if (DefaultMagic == MUTT_MBOX || DefaultMagic == MUTT_MMDF)
- return (DefaultMagic);
+ return DefaultMagic;
else
- return (MUTT_MBOX);
+ return MUTT_MBOX;
}
else if ((f = fopen (path, "r")) != NULL)
{
{
mutt_debug (1, "mx_get_magic(): unable to open file %s for reading.\n",
path);
- return (-1);
+ return -1;
}
#ifdef USE_COMPRESSED
if ((magic == 0) && mutt_comp_can_read (path))
return MUTT_COMPRESSED;
#endif
- return (magic);
+ return magic;
}
/*
else if (ascii_strcasecmp (s, "maildir") == 0)
DefaultMagic = MUTT_MAILDIR;
else
- return (-1);
+ return -1;
return 0;
}
mx_fastclose_mailbox (ctx);
if (!pctx)
FREE (&ctx);
- return (NULL);
+ return NULL;
}
mutt_make_label_hash (ctx);
}
unset_option (OPTFORCEREFRESH);
- return (ctx);
+ return ctx;
}
/* free up memory associated with the mailbox context */
if ((move_messages = query_quadoption (OPT_MOVE, buf)) == MUTT_ABORT)
{
ctx->closing = 0;
- return (-1);
+ return -1;
}
}
}
if ((purge = query_quadoption (OPT_DELETE, buf)) == MUTT_ABORT)
{
ctx->closing = 0;
- return (-1);
+ return -1;
}
}
{
if (!ctx->quiet)
mutt_message (_("Mailbox is unchanged."));
- return (0);
+ return 0;
}
if (ctx->deleted)
? _("Purge %d deleted message?") : _("Purge %d deleted messages?"),
ctx->deleted);
if ((purge = query_quadoption (OPT_DELETE, buf)) == MUTT_ABORT)
- return (-1);
+ return -1;
else if (purge == MUTT_NO)
{
if (!ctx->changed)
}
}
- return (rc);
+ return rc;
}
/* args:
FREE (&(*msg)->commited_path);
FREE (msg); /* __FREE_CHECKED__ */
- return (r);
+ return r;
}
void mx_alloc_memory (CONTEXT *ctx)
snprintf (dest, destlen, tmp, acct->user);
break;
}
- return (src);
+ return src;
}
/* Automatically loads a newsrc into memory, if necessary.
}
if (count == 0)
- return (-1);
+ return -1;
if (count > NumSigLines)
{
s++;
}
- return (-1);
+ return -1;
}
- return (0);
+ return 0;
}
static void
class->color = ColorQuote[0];
*QuoteList = class;
}
- return (*QuoteList);
+ return *QuoteList;
}
/* Did I mention how much I like emulating Lisp in C? */
if ((*buf = (unsigned char *) mutt_read_line ((char *) *buf, blen, f, &l, MUTT_EOL)) == NULL)
{
fmt[0] = 0;
- return (-1);
+ return -1;
}
*last_pos = ftello (f);
b_read = (int) (*last_pos - offset);
if ((fp = fopen (fname, "r")) == NULL)
{
mutt_perror (fname);
- return (-1);
+ return -1;
}
if (stat (fname, &sb) != 0)
{
mutt_perror (fname);
safe_fclose (&fp);
- return (-1);
+ return -1;
}
unlink (fname);
(ISSPACE (*line) && !offset)) /* end of headers */
{
*line = 0;
- return (line);
+ return line;
}
len = mutt_strlen (buf);
if (! len)
- return (line);
+ return line;
buf += len - 1;
if (*buf == '\n')
if ((ch = fgetc (f)) != ' ' && ch != '\t')
{
ungetc (ch, f);
- return (line); /* next line is a separate header field or EOH */
+ return line; /* next line is a separate header field or EOH */
}
/* eat tabs and spaces from the beginning of the continuation line */
int mutt_check_encoding (const char *c)
{
if (ascii_strncasecmp ("7bit", c, sizeof ("7bit")-1) == 0)
- return (ENC7BIT);
+ return ENC7BIT;
else if (ascii_strncasecmp ("8bit", c, sizeof ("8bit")-1) == 0)
- return (ENC8BIT);
+ return ENC8BIT;
else if (ascii_strncasecmp ("binary", c, sizeof ("binary")-1) == 0)
- return (ENCBINARY);
+ return ENCBINARY;
else if (ascii_strncasecmp ("quoted-printable", c, sizeof ("quoted-printable")-1) == 0)
- return (ENCQUOTEDPRINTABLE);
+ return ENCQUOTEDPRINTABLE;
else if (ascii_strncasecmp ("base64", c, sizeof("base64")-1) == 0)
- return (ENCBASE64);
+ return ENCBASE64;
else if (ascii_strncasecmp ("x-uuencode", c, sizeof("x-uuencode")-1) == 0)
- return (ENCUUENCODED);
+ return ENCUUENCODED;
#ifdef SUN_ATTACHMENT
else if (ascii_strncasecmp ("uuencode", c, sizeof("uuencode")-1) == 0)
- return (ENCUUENCODED);
+ return ENCUUENCODED;
#endif
else
- return (ENCOTHER);
+ return ENCOTHER;
}
static PARAMETER *parse_parameters (const char *s)
bail:
rfc2231_decode_parameters (&head);
- return (head);
+ return head;
}
int mutt_check_mime_type (const char *s)
FREE (&line);
- return (p);
+ return p;
}
void mutt_parse_part (FILE *fp, BODY *b)
msg->length = 0;
mutt_parse_part(fp, msg);
- return (msg);
+ return msg;
}
/* parse a multipart structure
if (!boundary)
{
mutt_error (_("multipart message has no boundary parameter!"));
- return (NULL);
+ return NULL;
}
blen = mutt_strlen (boundary);
for(last = head; last; last = last->next)
mutt_parse_part(fp, last);
- return (head);
+ return head;
}
static const char *uncomment_timezone (char *buf, size_t buflen, const char *tz)
{
case 0: /* day of the month */
if (mutt_atoi (t, &tm.tm_mday) < 0 || tm.tm_mday < 0)
- return (-1);
+ return -1;
if (tm.tm_mday > 31)
- return (-1);
+ return -1;
break;
case 1: /* month of the year */
if ((i = mutt_check_month (t)) < 0)
- return (-1);
+ return -1;
tm.tm_mon = i;
break;
case 2: /* year */
if (mutt_atoi (t, &tm.tm_year) < 0 || tm.tm_year < 0)
- return (-1);
+ return -1;
if (tm.tm_year < 50)
tm.tm_year += 100;
else if (tm.tm_year >= 1900)
else
{
mutt_debug (1, "parse_date: could not process time format: %s\n", t);
- return(-1);
+ return -1;
}
tm.tm_hour = hour;
tm.tm_min = min;
if (count < 4) /* don't check for missing timezone */
{
mutt_debug (1, "parse_date(): error parsing date format, using received time\n");
- return (-1);
+ return -1;
}
if (h)
}
}
- return (e);
+ return e;
}
ADDRESS *mutt_parse_adrlist (ADDRESS *p, const char *s)
!buf.data)
{
snprintf (err->data, err->dsize, _("Error in expression: %s"), pexpr);
- return (-1);
+ return -1;
}
if (!*buf.data)
{
snprintf (err->data, err->dsize, _("Empty expression"));
- return (-1);
+ return -1;
}
if (pat->stringmatch)
mutt_buffer_printf (err, "'%s': %s", buf.data, errmsg);
FREE (&buf.data);
FREE (&pat->p.rx);
- return (-1);
+ return -1;
}
FREE (&buf.data);
}
|| !buffer.data)
{
snprintf (err->data, err->dsize, _("Error in expression: %s"), pexpr);
- return (-1);
+ return -1;
}
if (!*buffer.data)
{
snprintf (err->data, err->dsize, _("Empty expression"));
- return (-1);
+ return -1;
}
memset (&min, 0, sizeof (min));
if ((pc = get_date (pc, &min, err)) == NULL)
{
FREE (&buffer.data);
- return (-1);
+ return -1;
}
haveMin = true;
SKIPWS (pc);
if (!parse_date_range (pc, &min, &max, haveMin, &baseMin, err))
{ /* bail out on any parsing error */
FREE (&buffer.data);
- return (-1);
+ return -1;
}
}
}
if ((s.fpout = safe_fopen (tempfile, "w+")) == NULL)
{
mutt_perror (tempfile);
- return (0);
+ return 0;
}
#endif
unlink (tempfile);
#endif
}
- return (0);
+ return 0;
}
fseeko (msg->fp, h->offset, 0);
tmp->child = curlist;
curlist = tmp;
}
- return (curlist);
+ return curlist;
}
static int
case MUTT_THREAD:
return (pat->not ^ match_threadcomplete(pat->child, flags, ctx, h->thread, 1, 1, 1, 1));
case MUTT_ALL:
- return (!pat->not);
+ return !pat->not;
case MUTT_EXPIRED:
return (pat->not ^ h->expired);
case MUTT_SUPERSEDED:
#ifdef USE_IMAP
/* IMAP search sets h->matched at search compile time */
if (ctx->magic == MUTT_IMAP && pat->stringmatch)
- return (h->matched);
+ return h->matched;
#endif
return (pat->not ^ msg_search (ctx, pat, h->msgno));
case MUTT_SENDER:
#endif
}
mutt_error (_("error: unknown op %d (report this error)."), pat->op);
- return (-1);
+ return -1;
}
static void quote_simple(char *tmp, size_t len, const char *p)
strfcpy (buf, NONULL (Context->pattern), sizeof (buf));
if (prompt || op != MUTT_LIMIT)
if (mutt_get_field (prompt, buf, sizeof (buf), MUTT_PATTERN | MUTT_CLEAR) != 0 || !buf[0])
- return (-1);
+ return -1;
mutt_message (_("Compiling search pattern..."));
FREE (&simple);
mutt_error ("%s", err.data);
FREE (&err.data);
- return (-1);
+ return -1;
}
#ifdef USE_IMAP
_("Search for: ") : _("Reverse search for: "),
buf, sizeof (buf),
MUTT_CLEAR | MUTT_PATTERN) != 0 || !buf[0])
- return (-1);
+ return -1;
if (op == OP_SEARCH || op == OP_SEARCH_NEXT)
unset_option (OPTSEARCHREVERSE);
mutt_error ("%s", err.data);
FREE (&err.data);
LastSearch[0] = '\0';
- return (-1);
+ return -1;
}
mutt_clear_error ();
}
else
{
mutt_message (_("Search hit bottom without finding match"));
- return (-1);
+ return -1;
}
}
else if (i < 0)
else
{
mutt_message (_("Search hit top without finding match"));
- return (-1);
+ return -1;
}
}
{
mutt_error (_("Search interrupted."));
SigInt = 0;
- return (-1);
+ return -1;
}
i += incr;
}
mutt_error (_("Not found."));
- return (-1);
+ return -1;
}
if (mutt_get_password (_("Enter PGP passphrase:"), PgpPass, sizeof (PgpPass)) == 0)
{
PgpExptime = time (NULL) + PgpTimeout;
- return (1);
+ return 1;
}
else
PgpExptime = 0;
unlink (pgptmpfile);
if (s->flags & MUTT_DISPLAY)
state_attach_puts (_("[-- Error: could not create a PGP subprocess! --]\n\n"), s);
- return (NULL);
+ return NULL;
}
/* send the PGP passphrase to the subprocess. Never do this if the
mutt_parse_part (fpout, tattach);
}
- return (tattach);
+ return tattach;
}
int pgp_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur)
if ((decoded_fp = safe_fopen (tempfile, "w+")) == NULL)
{
mutt_perror (tempfile);
- return (-1);
+ return -1;
}
unlink (tempfile);
mutt_mktemp (sigfile, sizeof (sigfile));
if ((fp = safe_fopen (sigfile, "w")) == NULL)
{
- return (NULL);
+ return NULL;
}
mutt_mktemp (signedfile, sizeof (signedfile));
{
mutt_perror ("fclose");
unlink (sigfile);
- return (NULL);
+ return NULL;
}
if (err)
unlink (sigfile);
/* most likely error is a bad passphrase, so automatically forget it */
pgp_void_passphrase ();
- return (NULL); /* fatal error while signing */
+ return NULL; /* fatal error while signing */
}
t = mutt_new_body ();
t->unlink = 1; /* ok to remove this file after sending. */
mutt_set_parameter ("name", "signature.asc", &t->parameter);
- return (a);
+ return a;
}
/* This routine attempts to find the keyids of the recipients of a message.
mutt_free_list (&crypt_hook_list);
}
- return (keylist);
+ return keylist;
}
/* Warning: "a" is no longer freed in this routine, you need
if ((fpout = safe_fopen (tempfile, "w+")) == NULL)
{
mutt_perror (tempfile);
- return (NULL);
+ return NULL;
}
mutt_mktemp (pgperrfile, sizeof (pgperrfile));
safe_fclose (&fpout);
safe_fclose (&pgperr);
unlink(pgpinfile);
- return (NULL);
+ return NULL;
}
if (sign)
if (sign)
pgp_void_passphrase (); /* just in case */
unlink (tempfile);
- return (NULL);
+ return NULL;
}
t = mutt_new_body ();
t->parts->next->unlink = 1; /* delete after sending the message */
t->parts->next->d_filename = safe_strdup ("msg.asc"); /* non pgp/mime can save */
- return (t);
+ return t;
}
BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist)
}
}
- return (msg->security);
+ return msg->security;
}
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, _mutt_fmt_pgp_command, data, 0);
- return (src);
+ return src;
}
static void mutt_pgp_command (char *d, size_t dlen, struct pgp_command_context *cctx, const char *fmt)
mutt_FormatString (dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
- return (src);
+ return src;
}
static void pgp_entry (char *s, size_t l, MUTTMENU * menu, int num)
set_option (OPTNEEDREDRAW);
- return (kp);
+ return kp;
}
pgp_key_t pgp_ask_for_key (char *tag, char *whatfor,
{
PostCount = 0;
LastModify = 0;
- return (0);
+ return 0;
}
if (S_ISDIR (st.st_mode))
#endif
}
- return (PostCount);
+ return PostCount;
}
void mutt_update_num_postponed (void)
int opt_delete;
if (!Postponed)
- return (-1);
+ return -1;
if ((PostContext = mx_open_mailbox (Postponed, MUTT_NOSORT, NULL)) == NULL)
{
PostCount = 0;
mutt_error (_("No postponed messages."));
- return (-1);
+ return -1;
}
if (! PostContext->msgcount)
mx_close_mailbox (PostContext, NULL);
FREE (&PostContext);
mutt_error (_("No postponed messages."));
- return (-1);
+ return -1;
}
if (PostContext->msgcount == 1)
{
mx_close_mailbox (PostContext, NULL);
FREE (&PostContext);
- return (-1);
+ return -1;
}
if (mutt_prepare_template (NULL, PostContext, hdr, h, 0) < 0)
{
mx_fastclose_mailbox (PostContext);
FREE (&PostContext);
- return (-1);
+ return -1;
}
/* finished with this message, so delete it. */
if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
crypt_opportunistic_encrypt (hdr);
- return (code);
+ return code;
}
memset (&s, 0, sizeof (s));
if (!fp && (msg = mx_open_message (ctx, hdr->msgno)) == NULL)
- return (-1);
+ return -1;
if (!fp) fp = msg->fp;
rfc822_free_address (&tmpa);
free_query (&results);
mutt_clear_error ();
- return (0);
+ return 0;
}
/* multiple results, choose from query menu */
query_menu (buf, buflen, results, 1);
}
- return (0);
+ return 0;
}
void mutt_query_menu (char *buf, size_t buflen)
if (level == 0)
mutt_update_tree (idx, *idxlen);
- return (idx);
+ return idx;
}
/* %c = character set: convert?
mutt_FormatString (dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
- return (src);
+ return src;
}
static void attach_entry (char *b, size_t blen, MUTTMENU *menu, int num)
if (!mutt_can_decode (top))
{
mutt_error (_("I don't know how to print %s attachments!"), type);
- return (0);
+ return 0;
}
}
}
if (!tag)
break;
}
- return (1);
+ return 1;
}
static void print_attachment_list (FILE *fp, int tag, BODY *top, STATE *state)
if ((flags & SENDLISTREPLY) && !env->to)
{
mutt_error (_("No mailing lists found!"));
- return (-1);
+ return -1;
}
mutt_fix_reply_recipients (env);
mutt_FormatString (dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
- return (src);
+ return src;
}
if (!(fqdn = mutt_fqdn (1)))
{
mutt_error (_("Please set the hostname variable to a proper value when using mixmaster!"));
- return (-1);
+ return -1;
}
/* Cc and Bcc are empty at this point. */
flush_par (s, &fst);
FREE (&buf);
- return (0);
+ return 0;
}
/*
}
}
- return (rv);
+ return rv;
}
void rfc822_free_address (ADDRESS **p)
if (!MoreArgs (s))
{
strfcpy (err->data, _("score: too few arguments"), err->dsize);
- return (-1);
+ return -1;
}
pattern = buf->data;
mutt_buffer_init (buf);
{
FREE (&pattern);
strfcpy (err->data, _("score: too many arguments"), err->dsize);
- return (-1);
+ return -1;
}
/* look for an existing entry and update the value, else add it to the end
if ((pat = mutt_pattern_comp (pattern, 0, err)) == NULL)
{
FREE (&pattern);
- return (-1);
+ return -1;
}
ptr = safe_calloc (1, sizeof (SCORE));
if (last)
{
FREE (&pattern);
strfcpy (err->data, _("Error: score: invalid number"), err->dsize);
- return (-1);
+ return -1;
}
set_option (OPTNEEDRESCORE);
return 0;
for (; lst; lst = lst->next)
{
if (addrcmp (a, lst))
- return (1);
+ return 1;
}
- return (0);
+ return 0;
}
/* removes addresses from "b" which are contained in "a" */
mutt_addrlist_to_local (*a);
rfc822_write_address (buf, sizeof (buf), *a, 0);
if (mutt_get_field (field, buf, sizeof (buf), MUTT_ALIAS) != 0)
- return (-1);
+ return -1;
rfc822_free_address (a);
*a = mutt_expand_aliases (mutt_parse_adrlist (NULL, buf));
if ((idna_ok = mutt_addrlist_to_intl (*a, &err)) != 0)
else
buf[0] = 0;
if (mutt_get_field ("Newsgroups: ", buf, sizeof (buf), 0) != 0)
- return (-1);
+ return -1;
FREE (&en->newsgroups);
en->newsgroups = safe_strdup (buf);
else
buf[0] = 0;
if (option (OPTASKFOLLOWUP) && mutt_get_field ("Followup-To: ", buf, sizeof (buf), 0) != 0)
- return (-1);
+ return -1;
FREE (&en->followup_to);
en->followup_to = safe_strdup (buf);
else
buf[0] = 0;
if (option (OPTXCOMMENTTO) && option (OPTASKXCOMMENTTO) && mutt_get_field ("X-Comment-To: ", buf, sizeof (buf), 0) != 0)
- return (-1);
+ return -1;
FREE (&en->x_comment_to);
en->x_comment_to = safe_strdup (buf);
}
#endif
{
if (edit_address (&en->to, "To: ") == -1 || en->to == NULL)
- return (-1);
+ return -1;
if (option (OPTASKCC) && edit_address (&en->cc, "Cc: ") == -1)
- return (-1);
+ return -1;
if (option (OPTASKBCC) && edit_address (&en->bcc, "Bcc: ") == -1)
- return (-1);
+ return -1;
if (option (OPTREPLYWITHXORIG) &&
(flags & (SENDREPLY|SENDLISTREPLY|SENDGROUPREPLY)) &&
(edit_address (&en->from, "From: ") == -1))
- return (-1);
+ return -1;
}
if (en->subject)
{
if (option (OPTFASTREPLY))
- return (0);
+ return 0;
else
strfcpy (buf, en->subject, sizeof (buf));
}
(!buf[0] && query_quadoption (OPT_SUBJECT, _("No subject, abort?")) != MUTT_NO))
{
mutt_message (_("No subject, aborting."));
- return (-1);
+ return -1;
}
mutt_str_replace (&en->subject, buf);
break;
default:
- return (-1); /* abort */
+ return -1; /* abort */
}
}
else
else
rfc822_append (to, env->from, 0);
- return (0);
+ return 0;
}
int mutt_fetch_recips (ENVELOPE *out, ENVELOPE *in, int flags)
if (in->mail_followup_to && hmfupto == MUTT_YES &&
default_to (&out->cc, in, flags & SENDLISTREPLY, hmfupto) == MUTT_ABORT)
- return (-1); /* abort */
+ return -1; /* abort */
}
else
{
if (default_to (&out->to, in, flags & SENDGROUPREPLY, hmfupto) == MUTT_ABORT)
- return (-1); /* abort */
+ return -1; /* abort */
if ((flags & SENDGROUPREPLY) && (!in->mail_followup_to || hmfupto != MUTT_YES))
{
* a limit such that none of the tagged message are visible.
*/
mutt_error (_("No tagged messages are visible!"));
- return (-1);
+ return -1;
}
}
else
if ((flags & SENDLISTREPLY) && !env->to)
{
mutt_error (_("No mailing lists found!"));
- return (-1);
+ return -1;
}
mutt_make_misc_reply_headers (env, ctx, cur, curenv);
make_reference_headers (tag ? NULL : curenv, env, ctx);
}
- return (0);
+ return 0;
}
static int
if (flags & SENDREPLY)
{
if ((i = query_quadoption (OPT_INCLUDE, _("Include message in reply?"))) == MUTT_ABORT)
- return (-1);
+ return -1;
if (i == MUTT_YES)
{
if (include_reply (ctx, h, tempfp) == -1)
{
mutt_error (_("Could not include all requested messages!"));
- return (-1);
+ return -1;
}
fputc ('\n', tempfp);
}
mutt_clear_error ();
- return (0);
+ return 0;
}
void mutt_set_followup_to (ENVELOPE *e)
if (!option (OPTREVREAL))
FREE (&tmp->personal);
}
- return (tmp);
+ return tmp;
}
ADDRESS *mutt_default_from (void)
adr->mailbox = safe_strdup (NONULL(Username));
}
- return (adr);
+ return adr;
}
static int send_message (HEADER *msg)
/* Write out the message in MIME form. */
mutt_mktemp (tempfile, sizeof (tempfile));
if ((tempfp = safe_fopen (tempfile, "w")) == NULL)
- return (-1);
+ return -1;
#ifdef USE_SMTP
old_write_bcc = option (OPTWRITEBCC);
{
safe_fclose (&tempfp);
unlink (tempfile);
- return (-1);
+ return -1;
}
if (fclose (tempfp) != 0)
{
mutt_perror (tempfile);
unlink (tempfile);
- return (-1);
+ return -1;
}
#ifdef MIXMASTER
i = mutt_invoke_sendmail (msg->env->from, msg->env->to, msg->env->cc,
msg->env->bcc, tempfile,
(msg->content->encoding == ENC8BIT));
- return (i);
+ return i;
}
/* rfc2047 encode the content-descriptions */
{
mutt_debug (1, "mutt_write_mime_body(): no boundary parameter found!\n");
mutt_error (_("No boundary parameter found! [report this error]"));
- return (-1);
+ return -1;
}
strfcpy (boundary, p, sizeof (boundary));
{
mutt_debug (1, "mutt_get_content_info: %s: %s (errno %d).\n",
fname, strerror (errno), errno);
- return (NULL);
+ return NULL;
}
info = safe_calloc (1, sizeof (CONTENT));
mutt_str_replace (&att->xtype, xtype);
}
- return (type);
+ return type;
}
static void transform_to_7bit (BODY *a, FILE *fpin)
if ((option(OPTMIMEFORWDECODE) || option(OPTFORWDECRYPT)) &&
(hdr->security & ENCRYPT)) {
if (!crypt_valid_passphrase(hdr->security))
- return (NULL);
+ return NULL;
}
}
safe_fclose (&fp);
- return (body);
+ return body;
}
BODY *mutt_make_file_attach (const char *path)
FREE(&info);
mutt_update_encoding (att);
- return (att);
+ return att;
}
static int get_toplevel_encoding (BODY *a)
for (; a; a = a->next)
{
if (a->encoding == ENCBINARY)
- return (ENCBINARY);
+ return ENCBINARY;
else if (a->encoding == ENC8BIT)
e = ENC8BIT;
}
- return (e);
+ return e;
}
/* check for duplicate boundary. return 1 if duplicate */
Weekdays[l->tm_wday], l->tm_mday, Months[l->tm_mon],
l->tm_year + 1900, l->tm_hour, l->tm_min, l->tm_sec,
(int) tz / 60, (int) abs ((int) tz) % 60);
- return (s);
+ return s;
}
/* wrapper around mutt_write_address() so we can handle very large
mutt_unblock_signals_system (1);
- return (st);
+ return st;
}
static char **
args[(*argslen)++] = addr->mailbox;
}
}
- return (args);
+ return args;
}
static char **
if (*argslen == *argsmax)
safe_realloc (&args, (*argsmax += 5) * sizeof (char *));
args[(*argslen)++] = s;
- return (args);
+ return args;
}
int
i = 1;
else
i = -1;
- return (i);
+ return i;
}
/* For postponing (!final) do the necessary encodings only */
}
}
- return (top);
+ return top;
}
static void set_noconv_flags (BODY *b, short flag)
{
mutt_debug (1, "mutt_write_fcc(): unable to open mailbox %s in append-mode, aborting.\n",
path);
- return (-1);
+ return -1;
}
/* We need to add a Content-Length field to avoid problems where a line in
{
mutt_perror (tempfile);
mx_close_mailbox (&f, NULL);
- return (-1);
+ return -1;
}
/* remember new mail status before appending message */
need_buffy_cleanup = 1;
{
safe_fclose(&tempfp);
mx_close_mailbox (&f, NULL);
- return (-1);
+ return -1;
}
/* post == 1 => postpone message. Set mode = -1 in mutt_write_rfc822_header()
#ifdef USE_SLANG_CURSES
static int mutt_intr_hook (void)
{
- return (-1);
+ return -1;
}
#endif /* USE_SLANG_CURSES */
if (mutt_get_password (_("Enter S/MIME passphrase:"), SmimePass, sizeof (SmimePass)) == 0)
{
SmimeExptime = time (NULL) + SmimeTimeout;
- return (1);
+ return 1;
}
else
SmimeExptime = 0;
mutt_FormatString (dest, destlen, col, cols, elsestring, _mutt_fmt_smime_command,
data, 0);
- return (src);
+ return src;
}
smime_free_key (&key);
}
- return (keylist);
+ return keylist;
}
if ((fpout = safe_fopen (tempfile, "w+")) == NULL)
{
mutt_perror (tempfile);
- return (NULL);
+ return NULL;
}
mutt_mktemp (smimeerrfile, sizeof (smimeerrfile));
mutt_unlink (smimeinfile);
mutt_unlink (certfile);
safe_fclose (&fpout);
- return (NULL);
+ return NULL;
}
safe_fclose (&smimein);
/* fatal error while trying to encrypt message */
if (!err) mutt_any_key_to_continue (_("No output from OpenSSL..."));
mutt_unlink (tempfile);
- return (NULL);
+ return NULL;
}
t = mutt_new_body ();
t->parts=0;
t->next=0;
- return (t);
+ return t;
}
{
mutt_any_key_to_continue (_("No output from OpenSSL..."));
mutt_unlink (signedfile);
- return (NULL); /* fatal error while signing */
+ return NULL; /* fatal error while signing */
}
t = mutt_new_body ();
t->encoding = ENCBASE64;
t->unlink = 1; /* ok to remove this file after sending. */
- return (a);
+ return a;
}
}
safe_fclose (&smimeerr);
- return (p);
+ return p;
}
if ((tmpfp = safe_fopen (tempfile, "w+")) == NULL)
{
mutt_perror (tempfile);
- return (-1);
+ return -1;
}
mutt_unlink (tempfile);
}
}
- return (msg->security);
+ return msg->security;
}
return (mutt_addr_for_display (a));
}
/* don't return NULL to avoid segfault when printing/comparing */
- return ("");
+ return "";
}
static int compare_to (const void *a, const void *b)
switch (method & SORT_MASK)
{
case SORT_RECEIVED:
- return (compare_date_received);
+ return compare_date_received;
case SORT_ORDER:
- return (compare_order);
+ return compare_order;
case SORT_DATE:
- return (compare_date_sent);
+ return compare_date_sent;
case SORT_SUBJECT:
- return (compare_subject);
+ return compare_subject;
case SORT_FROM:
- return (compare_from);
+ return compare_from;
case SORT_SIZE:
- return (compare_size);
+ return compare_size;
case SORT_TO:
- return (compare_to);
+ return compare_to;
case SORT_SCORE:
- return (compare_score);
+ return compare_score;
case SORT_SPAM:
- return (compare_spam);
+ return compare_spam;
case SORT_LABEL:
- return (compare_label);
+ return compare_label;
default:
- return (NULL);
+ return NULL;
}
/* not reached */
}
case 0:
*buf = 0;
- return (src);
+ return src;
default:
snprintf (buf, buflen, "%%%s%c", prefix, op);
else if (flags & MUTT_FORMAT_OPTIONAL)
_menu_status_line (buf, buflen, col, cols, menu, elsestring);
- return (src);
+ return src;
}
static void _menu_status_line (char *buf, size_t buflen, size_t col, int cols, MUTTMENU *menu, const char *p)
pid_t thepid;
if (!cmd || !*cmd)
- return (0);
+ return 0;
/* must ignore SIGINT and SIGQUIT */
rc = (thepid != -1) ? (WIFEXITED (rc) ? WEXITSTATUS (rc) : -1) : -1;
- return (rc);
+ return rc;
}
while (a)
{
if (a == b)
- return (1);
+ return 1;
a = a->parent;
}
- return (0);
+ return 0;
}
/* Determines whether to display a message's subject. */
/* if the user disabled subject hiding, display it */
if (!option (OPTHIDETHREADSUBJECT))
- return (1);
+ return 1;
/* if our subject is different from our parent's, display it */
if (hdr->subject_changed)
- return (1);
+ return 1;
/* if our subject is different from that of our closest previously displayed
* sibling, display the subject */
if (hdr && VISIBLE (hdr, ctx))
{
if (hdr->subject_changed)
- return (1);
+ return 1;
else
break;
}
if (hdr)
{
if (VISIBLE (hdr, ctx))
- return (0);
+ return 0;
else if (hdr->subject_changed)
- return (1);
+ return 1;
}
}
/* if we have no visible parent or previous sibling, display the subject */
- return (1);
+ return 1;
}
static void linearize_tree (CONTEXT *ctx)
cur = cur->next;
}
- return (subjects);
+ return subjects;
}
/* find the best possible match for a parent message based upon subject.
subjects = subjects->next;
FREE (&oldlist);
}
- return (last);
+ return last;
}
/* remove cur and its descendants from their current location.
*/
Sort ^= SORT_REVERSE;
if (!compare_threads (NULL, NULL))
- return (thread);
+ return thread;
top = thread;
{
Sort ^= SORT_REVERSE;
FREE (&array);
- return (top);
+ return top;
}
}
THREAD *top = NULL;
if (cur->message && cur->message->virtual >= 0)
- return (cur->message);
+ return cur->message;
top = cur;
if ((cur = cur->child) == NULL)
- return (NULL);
+ return NULL;
while (reverse && cur->next)
cur = cur->next;
while (true)
{
if (cur->message && cur->message->virtual >= 0)
- return (cur->message);
+ return cur->message;
if (cur->child)
{
{
cur = cur->parent;
if (cur == top)
- return (NULL);
+ return NULL;
}
cur = reverse ? cur->prev : cur->next;
}
if ((Sort & SORT_MASK) != SORT_THREADS)
{
mutt_error (_("Threading is not enabled."));
- return (hdr->virtual);
+ return hdr->virtual;
}
cur = hdr->thread;
{
cur = cur->next;
if (!cur)
- return (-1);
+ return -1;
tmp = find_virtual (cur, 0);
} while (!tmp);
}
{
cur = cur->prev;
if (!cur)
- return (-1);
+ return -1;
tmp = find_virtual (cur, 1);
} while (!tmp);
}
- return (tmp->virtual);
+ return tmp->virtual;
}
int mutt_parent_message (CONTEXT *ctx, HEADER *hdr, int find_root)
if ((Sort & SORT_MASK) != SORT_THREADS)
{
mutt_error (_("Threading is not enabled."));
- return (hdr->virtual);
+ return hdr->virtual;
}
/* Root may be the current message */
if (!parent)
{
mutt_error (_("Parent message is not available."));
- return (-1);
+ return -1;
}
if (!VISIBLE (parent, ctx))
{
mutt_error (_("Root message is not visible in this limited view."));
else
mutt_error (_("Parent message is not visible in this limited view."));
- return (-1);
+ return -1;
}
- return (parent->virtual);
+ return parent->virtual;
}
void mutt_set_virtual (CONTEXT *ctx)
if ((Sort & SORT_MASK) != SORT_THREADS && !(flag & MUTT_THREAD_GET_HIDDEN))
{
mutt_error (_("Threading is not enabled."));
- return (cur->virtual);
+ return cur->virtual;
}
final = cur->virtual;
{
/* return value depends on action requested */
if (flag & (MUTT_THREAD_COLLAPSE | MUTT_THREAD_UNCOLLAPSE))
- return (final);
+ return final;
else if (flag & MUTT_THREAD_UNREAD)
return ((old && new) ? new : (old ? old : new));
else if (flag & MUTT_THREAD_GET_HIDDEN)
- return (num_hidden);
+ return num_hidden;
else if (flag & MUTT_THREAD_NEXT_UNREAD)
- return (min_unread);
+ return min_unread;
}
while (true)
/* return value depends on action requested */
if (flag & (MUTT_THREAD_COLLAPSE | MUTT_THREAD_UNCOLLAPSE))
- return (final);
+ return final;
else if (flag & MUTT_THREAD_UNREAD)
return ((old && new) ? new : (old ? old : new));
else if (flag & MUTT_THREAD_GET_HIDDEN)
- return (num_hidden+1);
+ return num_hidden+1;
else if (flag & MUTT_THREAD_NEXT_UNREAD)
- return (min_unread);
+ return min_unread;
- return (0);
+ return 0;
#undef CHECK_LIMIT
}
int i, rc;
if ((Sort & SORT_MASK) != SORT_THREADS || !hdr->thread)
- return (1);
+ return 1;
threads[0] = hdr->thread;
while (threads[0]->parent)
if (flag)
rc += 1;
- return (rc);
+ return rc;
}