=================================================================== RCS file: /cvs/mandoc/term_ascii.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -p -r1.39 -r1.40 --- mandoc/term_ascii.c 2014/10/28 18:49:33 1.39 +++ mandoc/term_ascii.c 2014/11/20 13:56:20 1.40 @@ -1,4 +1,4 @@ -/* $Id: term_ascii.c,v 1.39 2014/10/28 18:49:33 schwarze Exp $ */ +/* $Id: term_ascii.c,v 1.40 2014/11/20 13:56:20 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -159,12 +159,14 @@ ascii_setwidth(struct termp *p, int iop, size_t width) { p->rmargin = p->defrmargin; - if (0 < iop) + if (iop > 0) p->defrmargin += width; - else if (0 > iop) + else if (iop == 0) + p->defrmargin = width ? width : p->lastrmargin; + else if (p->defrmargin > width) p->defrmargin -= width; else - p->defrmargin = width ? width : p->lastrmargin; + p->defrmargin = 0; p->lastrmargin = p->rmargin; p->rmargin = p->maxrmargin = p->defrmargin; }