FREE(&token.data);
FREE(&err.data);
- return 1;
+ return 1; // TEST15: neomutt -Q missing
}
mutt_message("%s", err.data);
}
FREE(&token.data);
FREE(&err.data);
- return 0;
+ return 0; // TEST16: neomutt -Q charset
}
/**
FREE(&token.data);
FREE(&err.data);
- return 1;
+ return 1; // TEST17: can't test
}
mutt_message("%s", err.data);
}
if ((uname(&utsname)) == -1)
{
mutt_perror(_("unable to determine nodename via uname()"));
- return 1;
+ return 1; // TEST09: can't test
}
/* some systems report the FQDN instead of just the hostname */
if (access(np->data, F_OK))
{
mutt_perror(np->data);
- return 1;
+ return 1; // TEST10: neomutt -F missing
}
}
}
if (source_rc(buffer, &err) != 0)
{
mutt_error("%s", err.data);
- need_pause = 1;
+ need_pause = 1; // TEST11: neomutt (error in /etc/neomuttrc)
}
}
}
if (source_rc(np->data, &err) != 0)
{
mutt_error("%s", err.data);
- need_pause = 1;
+ need_pause = 1; // TEST12: neomutt (error in ~/.neomuttrc)
}
}
}
if (execute_commands(commands) != 0)
- need_pause = 1;
+ need_pause = 1; // TEST13: neomutt -e broken
if (need_pause && !OPT_NO_CURSES)
{
log_queue_flush(log_disp_terminal);
if (mutt_any_key_to_continue(NULL) == 'q')
- return 1;
+ return 1; // TEST14: neomutt -e broken (press 'q')
}
mutt_file_mkdir(Tmpdir, S_IRWXU);
if (!Username)
{
mutt_error(_("unable to determine username"));
- return 1;
+ return 1; // TEST05: neomutt (unset $USER, delete user from /etc/passwd)
}
if (!HomeDir)
{
mutt_error(_("unable to determine home directory"));
- return 1;
+ return 1; // TEST06: neomutt (unset $HOME, delete user from /etc/passwd)
}
if (!Shell)
if (getegid() != getgid())
{
mutt_error("%s: I don't want to run with privileges!", argv[0]);
- goto main_exit;
+ goto main_exit; // TEST01: neomutt (as root, chgrp mail neomutt; chmod +s neomutt)
}
setlocale(LC_ALL, "");
int out = 0;
if (mutt_randbuf(&out, sizeof(out)) < 0)
- goto main_exit;
+ goto main_exit; // TEST02: neomutt (as root on non-Linux OS, rename /dev/urandom)
umask(077);
break;
default:
usage();
- goto main_ok;
+ goto main_ok; // TEST03: neomutt -9
}
}
}
print_version();
else
print_copyright();
- goto main_ok;
+ goto main_ok; // TEST04: neomutt -v
}
if (get_user_info() != 0)
if ((mutt_str_atos(dlevel, &num) < 0) || (num < LL_MESSAGE) || (num > LL_DEBUG5))
{
mutt_error(_("Error: value '%s' is invalid for -d."), dlevel);
- goto main_exit;
+ goto main_exit; // TEST07: neomutt -d xyz
}
set_default_value("debug_level", (intptr_t) num);
DebugLevel = num;
endwin();
if (crc != 0)
- goto main_curses;
+ goto main_curses; // TEST08: can't test -- fake term?
/* check whether terminal status is supported (must follow curses init) */
TSSupported = mutt_ts_capability();
if (dump_variables)
{
rc = mutt_dump_variables(hide_sensitive);
- goto main_curses;
+ goto main_curses; // TEST18: neomutt -D
}
if (!STAILQ_EMPTY(&alias_queries))
else
{
rc = 1;
- printf("%s\n", np->data);
+ printf("%s\n", np->data); // TEST19: neomutt -A unknown
}
}
mutt_list_free(&alias_queries);
- goto main_curses;
+ goto main_curses; // TEST20: neomutt -A alias
}
if (!OPT_NO_CURSES)
if (mutt_yesorno(msg2, MUTT_YES) == MUTT_YES)
{
if ((mkdir(fpath, 0700) == -1) && (errno != EEXIST))
- mutt_error(_("Can't create %s: %s."), Folder, strerror(errno));
+ mutt_error(_("Can't create %s: %s."), Folder, strerror(errno)); // TEST21: neomutt -n -F /dev/null (and ~/Mail doesn't exist)
}
}
}
if (batch_mode)
{
- goto main_ok;
+ goto main_ok; // TEST22: neomutt -B
}
if (sendflags & SENDPOSTPONED)
mutt_flushinp();
if (ci_send_message(SENDPOSTPONED, NULL, NULL, NULL, NULL) == 0)
rc = 0;
+ // TEST23: neomutt -p (postponed message, cancel)
+ // TEST24: neomutt -p (no postponed message)
log_queue_empty();
repeat_error = true;
}
if (url_parse_mailto(msg->env, &bodytext, argv[i]) < 0)
{
mutt_error(_("Failed to parse mailto: link"));
- goto main_curses;
+ goto main_curses; // TEST25: neomutt mailto:
}
}
else
if (!draft_file && Autoedit && !msg->env->to && !msg->env->cc)
{
mutt_error(_("No recipients specified."));
- goto main_curses;
+ goto main_curses; // TEST26: neomutt -s test (with autoedit=yes)
}
if (subject)
if (edit_infile)
{
mutt_error(_("Cannot use -E flag with stdin"));
- goto main_curses;
+ goto main_curses; // TEST27: neomutt -E -H -
}
fin = stdin;
}
if (!fin)
{
mutt_perror(expanded_infile);
- goto main_curses;
+ goto main_curses; // TEST28: neomutt -E -H missing
}
}
}
mutt_file_fclose(&fin);
mutt_perror(tempfile);
FREE(&tempfile);
- goto main_curses;
+ goto main_curses; // TEST29: neomutt -H existing-file (where tmpdir=/path/to/FILE blocking tmpdir)
}
if (fin)
{
{
mutt_perror(tempfile);
FREE(&tempfile);
- goto main_curses;
+ goto main_curses; // TEST30: can't test
}
}
/* If editing the infile, keep it around afterwards so
if (fstat(fileno(fin), &st) != 0)
{
mutt_perror(draft_file);
- goto main_curses;
+ goto main_curses; // TEST31: can't test
}
context_hdr->content->length = st.st_size;
{
mutt_error(_("%s: unable to attach file."), np->data);
mutt_list_free(&attach);
- goto main_curses;
+ goto main_curses; // TEST32: neomutt john@example.com -a missing
}
}
mutt_list_free(&attach);
if (truncate(expanded_infile, 0) == -1)
{
mutt_perror(expanded_infile);
- goto main_curses;
+ goto main_curses; // TEST33: neomutt -H read-only -s test john@example.com -E
}
fout = mutt_file_fopen(expanded_infile, "a");
if (!fout)
{
mutt_perror(expanded_infile);
- goto main_curses;
+ goto main_curses; // TEST34: can't test
}
/* If the message was sent or postponed, these will already
if ((mutt_write_mime_body(msg->content, fout) == -1))
{
mutt_file_fclose(&fout);
- goto main_curses;
+ goto main_curses; // TEST35: can't test
}
mutt_file_fclose(&fout);
}
mutt_free_windows();
if (rv != 0)
- goto main_curses;
+ goto main_curses; // TEST36: neomutt -H existing -s test john@example.com -E (cancel sending)
}
else
{
if (!mutt_buffy_check(false))
{
mutt_message(_("No mailbox with new mail."));
- goto main_curses;
+ goto main_curses; // TEST37: neomutt -Z (no new mail)
}
folder[0] = '\0';
mutt_buffy(folder, sizeof(folder));
OPT_NEWS = true;
CurrentNewsSrv = nntp_select_server(NewsServer, false);
if (!CurrentNewsSrv)
- goto main_curses;
+ goto main_curses; // TEST38: neomutt -G (unset news_server)
}
else
#endif
if (!Incoming)
{
mutt_error(_("No incoming mailboxes defined."));
- goto main_curses;
+ goto main_curses; // TEST39: neomutt -n -F /dev/null -y
}
folder[0] = '\0';
mutt_select_file(folder, sizeof(folder), MUTT_SEL_FOLDER | MUTT_SEL_BUFFY, NULL, NULL);
if (folder[0] == '\0')
{
- goto main_ok;
+ goto main_ok; // TEST40: neomutt -y (quit selection)
}
}
{
case -1:
mutt_perror(folder);
- goto main_curses;
+ goto main_curses; // TEST41: neomutt -z -f missing
case 1:
mutt_error(_("Mailbox is empty."));
- goto main_curses;
+ goto main_curses; // TEST42: neomutt -z -f /dev/null
}
}
mutt_log_stop();
mutt_free_opts();
mutt_free_windows();
+ // TEST43: neomutt (no change to mailbox)
+ // TEST44: neomutt (change mailbox)
}
main_ok: