summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c6
-rw-r--r--main.h2
-rw-r--r--term_ascii.c14
3 files changed, 21 insertions, 1 deletions
diff --git a/main.c b/main.c
index 6d4dd83a..86d70b67 100644
--- a/main.c
+++ b/main.c
@@ -447,7 +447,9 @@ main(int argc, char *argv[])
if (MANDOCLEVEL_OK != rc && curp.wstop)
break;
- argc--;
+
+ if (--argc && curp.outtype <= OUTT_UTF8)
+ ascii_sepline(curp.outdata);
}
if (curp.outfree)
@@ -635,6 +637,8 @@ passthrough(const char *file, int fd, int synopsis_only)
ssize_t nw;
int print;
+ fflush(stdout);
+
if ((stream = fdopen(fd, "r")) == NULL) {
close(fd);
syscall = "fdopen";
diff --git a/main.h b/main.h
index 17087e5d..7a6495c3 100644
--- a/main.h
+++ b/main.h
@@ -1,6 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -45,6 +46,7 @@ void *locale_alloc(const struct mchars *, char *);
void *utf8_alloc(const struct mchars *, char *);
void *ascii_alloc(const struct mchars *, char *);
void ascii_free(void *);
+void ascii_sepline(void *);
void *pdf_alloc(const struct mchars *, char *);
void *ps_alloc(const struct mchars *, char *);
diff --git a/term_ascii.c b/term_ascii.c
index 1231fd87..ee630493 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -174,6 +174,20 @@ ascii_setwidth(struct termp *p, int iop, size_t width)
p->rmargin = p->maxrmargin = p->defrmargin;
}
+void
+ascii_sepline(void *arg)
+{
+ struct termp *p;
+ size_t i;
+
+ p = (struct termp *)arg;
+ putchar('\n');
+ for (i = 0; i < p->defrmargin; i++)
+ putchar('-');
+ putchar('\n');
+ putchar('\n');
+}
+
static size_t
ascii_width(const struct termp *p, int c)
{