void
yyerror (char const *s)
{
- fprintf (stderr, "Line %d: %s\n", line, s);
+ fprintf (stderr, "Line %d: %s\n Saving your e-mail to default mailbox %s\n",
+ line, s, default_mailbox);
+ longjmp(env, 1);
}
default_mailbox = argv[2];
save_gids();
- read_conf(argv[1]);
+
init();
-// yydebug=1;
+
+ /* returning from longjump? save the mail and exit */
+ if (setjmp(env))
+ goto skip_conf;
+
+ read_conf(argv[1]);
res = yyparse ();
if (res)
temp_varcode_start = current_varcode;
compile(input_tree, NULL);
+skip_conf:
var_tab = xmalloc((max_varcode + 1) * sizeof(char*));
for (i = 0; i <= max_varcode; i++) {
var_tab[i] = empty;
}
current_headers = make_hlist(0);
-// print_headers(current_headers);
current_body = get_body(0);
save_current_headers(var_hash);
set_cur_mail_length_var(curr_email_len, var_hash);
+#include <setjmp.h>
#include "lists.h"
/* definitions of internal variables */
#define INT_VAR_LAST_EXIT "LAST_EXIT_CODE"
#define INT_VAR_PIPE_RES "LAST_OUTPUT"
+/* umpf.c */
+jmp_buf env;
+
/* cond.h */
int yylex (void);
void yyerror (char const *);