--- psiconv/trunk/program/psiconv/gen_txt.c 2000/10/21 00:49:13 53 +++ psiconv/trunk/program/psiconv/gen_txt.c 2002/01/29 18:38:38 142 @@ -21,11 +21,15 @@ #include "config.h" #include #include -#include "data.h" -#include "list.h" +#include "psiconv/data.h" +#include "psiconv/list.h" #include "gen.h" #include "psiconv.h" +#ifdef DMALLOC +#include "dmalloc.h" +#endif + /* * Various string tables for HTML4 settings @@ -96,11 +100,13 @@ int i; psiconv_paragraph para; - if (tf->page_sec->header->on_first_page) { - for (i=0; i < psiconv_list_length(tf->page_sec->header->text->paragraphs); i++) { - para = psiconv_list_get(tf->page_sec->header->text->paragraphs, i); - fput_text(of, para->text, strlen(para->text)); - fputs("\n", of); + if (tf->page_sec->header->text) { + if (tf->page_sec->header->on_first_page) { + for (i=0; i < psiconv_list_length(tf->page_sec->header->text->paragraphs); i++) { + para = psiconv_list_get(tf->page_sec->header->text->paragraphs, i); + fput_text(of, para->text, strlen(para->text)); + fputs("\n", of); + } } } fputs("\n",of); @@ -111,10 +117,12 @@ } fputs("\n",of); - for (i=0; i < psiconv_list_length(tf->page_sec->footer->text->paragraphs); i++) { - para = psiconv_list_get(tf->page_sec->footer->text->paragraphs, i); - fput_text(of, para->text, strlen(para->text)); - fputs("\n", of); + if (tf->page_sec->header->text) { + for (i=0; i < psiconv_list_length(tf->page_sec->footer->text->paragraphs); i++) { + para = psiconv_list_get(tf->page_sec->footer->text->paragraphs, i); + fput_text(of, para->text, strlen(para->text)); + fputs("\n", of); + } } } @@ -163,7 +171,7 @@ return fclose(of); } -static struct psiconv_fileformat ff = +static struct psiconv_fileformat_s ff = { "ASCII", "Plain text without much layout",