projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ascii: Fix ascii_flush().
[pspp-builds.git]
/
src
/
output
/
ascii.c
diff --git
a/src/output/ascii.c
b/src/output/ascii.c
index 4978e125cc67829c1fd9356f838c3a39f4e36b52..afd915262478a8c9d9bc921181c469df4b56ecca 100644
(file)
--- a/
src/output/ascii.c
+++ b/
src/output/ascii.c
@@
-352,8
+352,15
@@
static void
ascii_flush (struct output_driver *driver)
{
struct ascii_driver *a = ascii_driver_cast (driver);
ascii_flush (struct output_driver *driver)
{
struct ascii_driver *a = ascii_driver_cast (driver);
- if (a->file != NULL)
- fflush (a->file);
+ if (a->y > 0)
+ {
+ ascii_close_page (a);
+
+ if (fn_close (a->file_name, a->file) != 0)
+ error (0, errno, _("ascii: closing output file \"%s\""),
+ a->file_name);
+ a->file = NULL;
+ }
}
static void
}
static void
@@
-408,10
+415,7
@@
ascii_submit (struct output_driver *driver,
}
if (a->file == NULL)
}
if (a->file == NULL)
- {
- ascii_open_page (a);
- a->y = 0;
- }
+ ascii_open_page (a);
page = render_page_create (¶ms, table_item_get_table (table_item));
for (render_break_init (&x_break, page, H);
page = render_page_create (¶ms, table_item_get_table (table_item));
for (render_break_init (&x_break, page, H);
@@
-435,7
+439,6
@@
ascii_submit (struct output_driver *driver,
{
assert (a->y > 0);
ascii_close_page (a);
{
assert (a->y > 0);
ascii_close_page (a);
- a->y = 0;
ascii_open_page (a);
continue;
}
ascii_open_page (a);
continue;
}
@@
-915,4
+918,6
@@
ascii_close_page (struct ascii_driver *a)
putc ('\n', a->file);
if (a->paginate)
putc ('\f', a->file);
putc ('\n', a->file);
if (a->paginate)
putc ('\f', a->file);
+
+ a->y = 0;
}
}