X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=umpf.c;h=b8c2cd9effe94c6a194ef68dc2451d29e6ece128;hb=8628def3891660a2ebfce358dc65cf6b0f0a92d1;hp=3dfef8199fb21f047ab9e6b6ba1f6f732e2e8136;hpb=fe58a4c2ebb3d4ff4649e58f67324214d7f6f863;p=umpf.git diff --git a/umpf.c b/umpf.c index 3dfef81..b8c2cd9 100644 --- a/umpf.c +++ b/umpf.c @@ -1,4 +1,5 @@ #include +#include #include #include "umpf.h" @@ -11,12 +12,14 @@ init(void) const_tab = xmalloc(BUFSIZE); cur_const_n = 1; cur_const_s = BUFSIZE; + empty = ""; } int main(int argc, char** argv) { int res; + int i; if (argc < 2) die("Usage: ./umpf conf_file [default_mailbox]"); @@ -40,10 +43,16 @@ main(int argc, char** argv) temp_varcode_start = current_varcode; compile(input_tree, NULL); - current_headers = make_hlist(); + 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(); + current_body = get_body(0); save_current_headers(var_hash); + set_cur_mail_length_var(curr_email_len, var_hash); interp(&input_code, var_hash);