]> mj.ucw.cz Git - umpf.git/blobdiff - umpf.c
fix saving bodies
[umpf.git] / umpf.c
diff --git a/umpf.c b/umpf.c
index 3dfef8199fb21f047ab9e6b6ba1f6f732e2e8136..19910a4a28376c4e894ab5c62ec491b8d5fbaf76 100644 (file)
--- a/umpf.c
+++ b/umpf.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 #include <pwd.h>
 
 #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,6 +43,11 @@ main(int argc, char** argv)
        temp_varcode_start = current_varcode;
        compile(input_tree, NULL);
 
+       var_tab = xmalloc((max_varcode + 1) * sizeof(char*));
+       for (i = 0; i <= max_varcode; i++) {
+               var_tab[i] = empty;
+       }       
+
        current_headers = make_hlist();
 //     print_headers(current_headers);
        current_body = get_body();