diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2022-01-12 04:53:58 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2022-01-12 04:53:58 +0000 |
commit | 31310fbefda4626138cb816bffaa20f89a18cc4d (patch) | |
tree | a037ebdefef1ea66e39579d74013702ad7f9a863 /usr.bin | |
parent | 66fd0132ceef93f9e9a4137d50c02cd83f88d20c (diff) |
More accurately represent cells containing horizontal lines in -T tree
output. In particular, do not represent "_" as "-", and distinguish "_"
from "\_" and "=" from "\=".
Output tweak following a related question from
Ted Bullock <tbullock at comlore dot com>.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/tree.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/mandoc/tree.c b/usr.bin/mandoc/tree.c index be6dab878a6..98b80b56aac 100644 --- a/usr.bin/mandoc/tree.c +++ b/usr.bin/mandoc/tree.c @@ -1,7 +1,7 @@ -/* $OpenBSD: tree.c,v 1.58 2021/09/07 10:58:44 schwarze Exp $ */ +/* $OpenBSD: tree.c,v 1.59 2022/01/12 04:53:57 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2013-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2013-2015, 2017-2022 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 @@ -507,12 +507,16 @@ print_span(const struct tbl_span *sp, int indent) putchar('x'); } switch (dp->pos) { - case TBL_DATA_HORIZ: case TBL_DATA_NHORIZ: - putchar('-'); + putchar('\\'); + /* FALLTHROUGH */ + case TBL_DATA_HORIZ: + putchar('_'); break; - case TBL_DATA_DHORIZ: case TBL_DATA_NDHORIZ: + putchar('\\'); + /* FALLTHROUGH */ + case TBL_DATA_DHORIZ: putchar('='); break; default: |