=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/out.c,v retrieving revision 1.34 retrieving revision 1.35 diff -c -r1.34 -r1.35 *** src/usr.bin/mandoc/out.c 2015/10/12 00:07:27 1.34 --- src/usr.bin/mandoc/out.c 2017/05/01 20:53:58 1.35 *************** *** 1,7 **** ! /* $OpenBSD: out.c,v 1.34 2015/10/12 00:07:27 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons ! * Copyright (c) 2011, 2014, 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above --- 1,7 ---- ! /* $OpenBSD: out.c,v 1.35 2017/05/01 20:53:58 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons ! * Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above *************** *** 195,203 **** */ if (nxcol && totalwidth) { ! xwidth = totalwidth - xwidth - 3*maxcol - (opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ? 2 : !!opts->lvert + !!opts->rvert); /* * Emulate a bug in GNU tbl width calculation that --- 195,206 ---- */ if (nxcol && totalwidth) { ! xwidth += 3*maxcol + (opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ? 2 : !!opts->lvert + !!opts->rvert); + if (xwidth >= totalwidth) + return; + xwidth = totalwidth - xwidth; /* * Emulate a bug in GNU tbl width calculation that