aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_ps.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-30 21:28:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-30 21:28:01 +0000
commit75c49a4fece7c409c4b5a3013a40f5f352eced01 (patch)
tree73acbdbfce6225ca87662d738bcca054d597209d /term_ps.c
parentb1938d01834105572311aa9b06d667939309bee7 (diff)
downloadmandoc-75c49a4fece7c409c4b5a3013a40f5f352eced01.tar.gz
mandoc-75c49a4fece7c409c4b5a3013a40f5f352eced01.tar.zst
mandoc-75c49a4fece7c409c4b5a3013a40f5f352eced01.zip
Support relative arguments to .ll (increase or decrease line length).
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/term_ps.c b/term_ps.c
index 9e0743a0..e8bcde82 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -1,4 +1,4 @@
-/* $Id: term_ps.c,v 1.57 2014/03/30 19:47:48 schwarze Exp $ */
+/* $Id: term_ps.c,v 1.58 2014/03/30 21:28:01 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -106,7 +106,7 @@ __attribute__((__format__ (__printf__, 2, 3)))
static void ps_printf(struct termp *, const char *, ...);
static void ps_putchar(struct termp *, char);
static void ps_setfont(struct termp *, enum termfont);
-static void ps_setwidth(struct termp *, size_t);
+static void ps_setwidth(struct termp *, int, size_t);
static struct termp *pspdf_alloc(char *);
static void pdf_obj(struct termp *, size_t);
@@ -536,12 +536,17 @@ pspdf_alloc(char *outopts)
static void
-ps_setwidth(struct termp *p, size_t width)
+ps_setwidth(struct termp *p, int iop, size_t width)
{
size_t lastwidth;
lastwidth = p->ps->width;
- p->ps->width = width ? width : p->ps->lastwidth;
+ if (0 < iop)
+ p->ps->width += width;
+ else if (0 > iop)
+ p->ps->width -= width;
+ else
+ p->ps->width = width ? width : p->ps->lastwidth;
p->ps->lastwidth = lastwidth;
}