-/* $Id: term_ps.c,v 1.68 2014/10/28 17:36:19 schwarze Exp $ */
+/* $Id: term_ps.c,v 1.70 2014/12/01 08:05:52 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
#include <string.h>
#include <unistd.h>
-#include "mandoc.h"
#include "mandoc_aux.h"
#include "out.h"
-#include "main.h"
#include "term.h"
+#include "main.h"
/* These work the buffer used by the header and footer. */
#define PS_BUFSLOP 128
size_t lastwidth;
lastwidth = p->ps->width;
- if (0 < iop)
+ if (iop > 0)
p->ps->width += width;
- else if (0 > iop)
+ else if (iop == 0)
+ p->ps->width = width ? width : p->ps->lastwidth;
+ else if (p->ps->width > width)
p->ps->width -= width;
else
- p->ps->width = width ? width : p->ps->lastwidth;
+ p->ps->width = 0;
p->ps->lastwidth = lastwidth;
}