X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Foutput%2Fhtml.c;h=658858be3f6ddaca01688759c8e5dd341b1a9a63;hb=ebf3b993687a25782fe72f45bf3e72aa4bee7c95;hp=50561df7c4cc33ea289b55ed1def861cd669f694;hpb=2322678e8fddbbf158b01b2720db2636404bba3b;p=pspp-builds.git diff --git a/src/output/html.c b/src/output/html.c index 50561df7..658858be 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -17,33 +17,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* This #if encloses the rest of the file. */ -#if !NO_HTML - #include #include "chart.h" #include "htmlP.h" -#include "message.h" +#include #include #include #include #include - -#if HAVE_UNISTD_H #include -#endif -#include "alloc.h" -#include "compiler.h" -#include "message.h" -#include "filename.h" +#include +#include +#include +#include #include "getline.h" #include "getlogin_r.h" #include "output.h" #include "manager.h" #include "table.h" -#include "version.h" -#include "make-file.h" +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -305,7 +299,7 @@ postopen (struct file_ext *f) html_var_tab = dict; while (-1 != getline (&buf, &buf_size, prologue_file)) { - char *buf2; + int len; if (strstr (buf, "!!!")) @@ -334,12 +328,14 @@ postopen (struct file_ext *f) } /* PORTME: Line terminator. */ - buf2 = fn_interp_vars (buf, html_get_var); - len = strlen (buf2); - fwrite (buf2, len, 1, f->file); - if (buf2[len - 1] != '\n') + struct string line; + ds_create(&line, buf); + fn_interp_vars(&line, html_get_var); + len = ds_length(&line); + fwrite (ds_c_str(&line), len, 1, f->file); + if (ds_c_str(&line)[len - 1] != '\n') putc ('\n', f->file); - free (buf2); + ds_destroy(&line); } if (ferror (f->file)) msg (IE, _("Reading `%s': %s."), prologue_fn, strerror (errno)); @@ -648,6 +644,3 @@ struct outp_class html_class = html_finalise_chart }; - -#endif /* !NO_HTML */ -