"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/mx/main.c" between
s-nail-14.9.21.tar.xz and s-nail-14.9.22.tar.xz

About: S-nail is a mail processing system intended to provide the functionality of the POSIX mailx command and offers extensions for line editing, IDNA, MIME, S/MIME, SMTP and POP3 (and IMAP). It is usable as a mail batch language.

main.c  (s-nail-14.9.21.tar.xz):main.c  (s-nail-14.9.22.tar.xz)
skipping to change at line 367 skipping to change at line 367
if(!ok_blook(quiet)) if(!ok_blook(quiet))
fprintf(n_stdout, _("%s version %s. Type `?' for help\n"), fprintf(n_stdout, _("%s version %s. Type `?' for help\n"),
n_uagent, n_uagent,
(su_state_has(su_STATE_REPRODUCIBLE) (su_state_has(su_STATE_REPRODUCIBLE)
? su_reproducible_build : ok_vlook(version))); ? su_reproducible_build : ok_vlook(version)));
n_folder_announce(n_ANNOUNCE_MAIN_CALL | n_ANNOUNCE_CHANGE); n_folder_announce(n_ANNOUNCE_MAIN_CALL | n_ANNOUNCE_CHANGE);
safe_signal(SIGINT, prevint); safe_signal(SIGINT, prevint);
} }
/* Enter the command loop */ /* Enter the command loop */
if(n_psonce & n_PSO_INTERACTIVE)
mx_tty_init();
/* "load()" more commands given on command line */ /* "load()" more commands given on command line */
if(mcp->mc_Y_cnt > 0 && !n_go_load_lines(TRU1, mcp->mc_Y, mcp->mc_Y_cnt)) if(mcp->mc_Y_cnt > 0 && !n_go_load_lines(TRU1, mcp->mc_Y, mcp->mc_Y_cnt))
n_exit_status = n_EXIT_ERR; n_exit_status = n_EXIT_ERR;
else else
n_go_main_loop(); n_go_main_loop();
if(n_psonce & n_PSO_INTERACTIVE)
mx_tty_destroy((n_psonce & n_PSO_XIT) != 0);
if(!(n_psonce & n_PSO_XIT)){ if(!(n_psonce & n_PSO_XIT)){
if(mb.mb_type == MB_FILE || mb.mb_type == MB_MAILDIR){ if(mb.mb_type == MB_FILE || mb.mb_type == MB_MAILDIR){
safe_signal(SIGHUP, SIG_IGN); safe_signal(SIGHUP, SIG_IGN);
safe_signal(SIGINT, SIG_IGN); safe_signal(SIGINT, SIG_IGN);
safe_signal(SIGQUIT, SIG_IGN); safe_signal(SIGQUIT, SIG_IGN);
} }
jquit: jquit:
save_mbox_for_possible_quitstuff(); save_mbox_for_possible_quitstuff();
quit(FAL0); quit(FAL0);
skipping to change at line 1128 skipping to change at line 1124
if(mc.mc_u != NIL) if(mc.mc_u != NIL)
mc.mc_folder = mc.mc_u; mc.mc_folder = mc.mc_u;
} }
/* /*
* We have reached our second program state, the command line options have * We have reached our second program state, the command line options have
* been worked and verified a bit, we are likely to go, perform more setup * been worked and verified a bit, we are likely to go, perform more setup
*/ */
n_psonce |= n_PSO_STARTED_GETOPT; n_psonce |= n_PSO_STARTED_GETOPT;
ASSERT(!(n_poption & n_PO_QUICKRUN_MASK) ||
!(n_psonce & n_PSO_INTERACTIVE));
a_main_setup_vars(); a_main_setup_vars();
/* Create memory pool snapshot; Memory is auto-reclaimed from now on */ /* Create memory pool snapshot; Memory is auto-reclaimed from now on */
su_mem_bag_fixate(n_go_data->gdc_membag); su_mem_bag_fixate(n_go_data->gdc_membag);
/* load() any resource files */ /* load() any resource files */
if(resfiles & a_RF_MASK){ if(resfiles & a_RF_MASK){
/* *expand() returns a savestr(), but load() only uses the file name /* *expand() returns a savestr(), but load() only uses the file name
* for fopen(), so it is safe to do this */ * for fopen(), so it is safe to do this */
skipping to change at line 1200 skipping to change at line 1198
ASSERT(n_smopts_cnt + 1 <= mc.mc_smopts_size); ASSERT(n_smopts_cnt + 1 <= mc.mc_smopts_size);
n_smopts[n_smopts_cnt++] = cp; n_smopts[n_smopts_cnt++] = cp;
}while((cp = argv[++i]) != NIL); }while((cp = argv[++i]) != NIL);
} }
}else if(argv[i] != NIL) }else if(argv[i] != NIL)
goto je_expandargv; goto je_expandargv;
/* We had to wait until the resource files are loaded and any command line /* We had to wait until the resource files are loaded and any command line
* setting has been restored, but get the termcap up and going before we * setting has been restored, but get the termcap up and going before we
* switch account or running commands */ * switch account or running commands */
if(n_psonce & n_PSO_INTERACTIVE){
#ifdef mx_HAVE_TCAP #ifdef mx_HAVE_TCAP
if(n_psonce & n_PSO_TTYANY)
mx_termcap_init(); mx_termcap_init();
#endif #endif
/* We have to fake some state of readiness in order to allow resolving of
* lazy `bind's (from config files); this is ok and allows one call to
* tty_init() (and one to tty_destroy()) instead of two according pairs
* for send and receive mode, which also had the ugly effect that -A
* account switch and -X commands ran without properly setup tty/MLE! */
n_psonce |= n_PSO_STARTED_CONFIG;
mx_tty_init();
n_psonce ^= n_PSO_STARTED_CONFIG;
}
/* Now we can set the account */ /* Now we can set the account */
if(mc.mc_A != NIL){ if(mc.mc_A != NIL){
char const *a[2]; char const *a[2];
a[0] = mc.mc_A; a[0] = mc.mc_A;
a[1] = NIL; a[1] = NIL;
if(c_account(a) && (!(n_psonce & n_PSO_INTERACTIVE) || if(c_account(a) && (!(n_psonce & n_PSO_INTERACTIVE) ||
ok_blook(errexit) || ok_blook(posix))){ ok_blook(errexit) || ok_blook(posix))){
n_exit_status = n_EXIT_USE | n_EXIT_SEND_ERROR; n_exit_status = n_EXIT_USE | n_EXIT_SEND_ERROR;
skipping to change at line 1272 skipping to change at line 1279
BITENUM_IS(u32,mx_attachments_error) aerr; BITENUM_IS(u32,mx_attachments_error) aerr;
mc.mc_attach = mx_attachments_append(mc.mc_attach, mc.mc_attach = mx_attachments_append(mc.mc_attach,
mc.mc_a_head->maa_file, &aerr, NIL); mc.mc_a_head->maa_file, &aerr, NIL);
if(aerr != mx_ATTACHMENTS_ERR_NONE){ if(aerr != mx_ATTACHMENTS_ERR_NONE){
n_exit_status = n_EXIT_ERR; n_exit_status = n_EXIT_ERR;
goto jleave_full; goto jleave_full;
} }
} }
if(n_psonce & n_PSO_INTERACTIVE)
mx_tty_init();
/* "load()" more commands given on command line */ /* "load()" more commands given on command line */
if(mc.mc_Y_cnt > 0 && !n_go_load_lines(TRU1, mc.mc_Y, mc.mc_Y_cnt)) if(mc.mc_Y_cnt > 0 && !n_go_load_lines(TRU1, mc.mc_Y, mc.mc_Y_cnt))
n_exit_status = n_EXIT_ERR; n_exit_status = n_EXIT_ERR;
else else
n_mail((((n_psonce & n_PSO_INTERACTIVE n_mail((((n_psonce & n_PSO_INTERACTIVE
) ? n_MAILSEND_HEADERS_PRINT : 0) | ) ? n_MAILSEND_HEADERS_PRINT : 0) |
(n_poption & n_PO_F_FLAG ? n_MAILSEND_RECORD_RECIPIENT : 0)), (n_poption & n_PO_F_FLAG ? n_MAILSEND_RECORD_RECIPIENT : 0)),
mc.mc_to, mc.mc_cc, mc.mc_bcc, mc.mc_subject, mc.mc_to, mc.mc_cc, mc.mc_bcc, mc.mc_subject,
mc.mc_attach, mc.mc_quote); mc.mc_attach, mc.mc_quote);
if(n_psonce & n_PSO_INTERACTIVE)
mx_tty_destroy((n_psonce & n_PSO_XIT) != 0);
} }
jleave_full: jleave_full:/* C99 */{
i = n_exit_status; char const *ccp;
boole was_xit;
n_psonce &= ~n_PSO_EXIT_MASK; i = n_exit_status;
mx_account_leave(); was_xit = ((n_psonce & n_PSO_XIT) != 0);
n_psonce &= ~n_PSO_EXIT_MASK; n_psonce &= ~n_PSO_EXIT_MASK;
/* C99 */{ mx_account_leave();
char const *ccp;
if(n_psonce & n_PSO_INTERACTIVE){
mx_tty_destroy(was_xit);
#ifdef mx_HAVE_TCAP
mx_termcap_destroy();
#endif
}
n_psonce &= ~n_PSO_EXIT_MASK;
if((ccp = ok_vlook(on_program_exit)) != NIL) if((ccp = ok_vlook(on_program_exit)) != NIL)
temporary_on_xy_hook_caller("on-program-exit", ccp, FAL0); temporary_on_xy_hook_caller("on-program-exit", ccp, FAL0);
}
n_exit_status = i;
n_exit_status = i;
}
jleave: jleave:
#ifdef su_HAVE_DEBUG #ifdef su_HAVE_DEBUG
su_mem_bag_gut(n_go_data->gdc_membag); /* Was init in go_init() */ su_mem_bag_gut(n_go_data->gdc_membag); /* Was init in go_init() */
su_mem_set_conf(su_MEM_CONF_LINGER_FREE_RELEASE, 0); su_mem_set_conf(su_MEM_CONF_LINGER_FREE_RELEASE, 0);
#endif #endif
NYD_OU; NYD_OU;
return n_exit_status; return n_exit_status;
} }
#include "su/code-ou.h" #include "su/code-ou.h"
/* Source the others in that case! */ /* Source the others in that case! */
#ifdef mx_HAVE_AMALGAMATION #ifdef mx_HAVE_AMALGAMATION
# include <mx/gen-config.h> # include <mx/gen-config.h>
#endif #endif
 End of changes. 15 change blocks. 
19 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)