diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-06-29 22:12:55 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-06-29 22:12:55 +0000 |
commit | 26961d2bc53d304d95d0d644f2ff4146623b53fb (patch) | |
tree | 9f1220fc4eecd26dd58223141aa077bf161614bc /regress/usr.bin/mandoc/roff | |
parent | f995e6431e8f77fdb5fe9c822bdba1939078da3e (diff) |
Major roff_getname() cleanup.
* Return the name even if it is terminated by an escape sequence, not a blank.
* Skip the full escape sequence using mandoc_escape(), not just the first byte.
* Make it non-destructive, return the length instead of writing a '\0'.
* Let .ds and .as cope with the above changes to the internal interface.
* Fix .rm and .rr to accept an escape sequence as the end of a name.
* Fix .nr and .rr to not set/delete a register with an empty name.
Diffstat (limited to 'regress/usr.bin/mandoc/roff')
-rw-r--r-- | regress/usr.bin/mandoc/roff/ds/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/ds/escname.in | 14 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/ds/escname.out_ascii | 11 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/nr/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/nr/escname.in | 15 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/nr/escname.out_ascii | 17 |
6 files changed, 61 insertions, 4 deletions
diff --git a/regress/usr.bin/mandoc/roff/ds/Makefile b/regress/usr.bin/mandoc/roff/ds/Makefile index cbb879f5580..98a93d753fd 100644 --- a/regress/usr.bin/mandoc/roff/ds/Makefile +++ b/regress/usr.bin/mandoc/roff/ds/Makefile @@ -1,5 +1,5 @@ -# $OpenBSD: Makefile,v 1.4 2014/04/07 21:00:00 schwarze Exp $ +# $OpenBSD: Makefile,v 1.5 2014/06/29 22:12:54 schwarze Exp $ -REGRESS_TARGETS = append nested quoting +REGRESS_TARGETS = append escname nested quoting .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/roff/ds/escname.in b/regress/usr.bin/mandoc/roff/ds/escname.in new file mode 100644 index 00000000000..6394144b552 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/ds/escname.in @@ -0,0 +1,14 @@ +.Dd June 29, 2014 +.Dt DS-ESCNAME 1 +.Os OpenBSD +.Sh NAME +.Nm ds-escname +.Nd escape sequences in string names +.Sh DESCRIPTION +.ds std\\esc stdval +Now \e*[std\\esc] is +.Sq \*[std\\esc] . +.Pp +.ds esc\eesc escval +Now \e*[esc] is +.Sq \*[esc] . diff --git a/regress/usr.bin/mandoc/roff/ds/escname.out_ascii b/regress/usr.bin/mandoc/roff/ds/escname.out_ascii new file mode 100644 index 00000000000..48d6bb51a3d --- /dev/null +++ b/regress/usr.bin/mandoc/roff/ds/escname.out_ascii @@ -0,0 +1,11 @@ +DS-ESCNAME(1) OpenBSD Reference Manual DS-ESCNAME(1) + +NNAAMMEE + ddss--eessccnnaammee - escape sequences in string names + +DDEESSCCRRIIPPTTIIOONN + Now \*[std\esc] is `stdval'. + + Now \*[esc] is `'. + +OpenBSD June 29, 2014 OpenBSD diff --git a/regress/usr.bin/mandoc/roff/nr/Makefile b/regress/usr.bin/mandoc/roff/nr/Makefile index e642dadeb26..a7bc4115a14 100644 --- a/regress/usr.bin/mandoc/roff/nr/Makefile +++ b/regress/usr.bin/mandoc/roff/nr/Makefile @@ -1,5 +1,5 @@ -# $OpenBSD: Makefile,v 1.5 2014/04/07 15:05:12 schwarze Exp $ +# $OpenBSD: Makefile,v 1.6 2014/06/29 22:12:54 schwarze Exp $ -REGRESS_TARGETS = argc eval int predef rr +REGRESS_TARGETS = argc eval escname int predef rr .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/roff/nr/escname.in b/regress/usr.bin/mandoc/roff/nr/escname.in new file mode 100644 index 00000000000..712b1d78d33 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/nr/escname.in @@ -0,0 +1,15 @@ +.TH NR-ESCNAME 1 "June 29, 2014" OpenBSD +.SH NAME +nr-escname \- escape sequences in register names +.SH DESCRIPTION +.nr first 1 +.nr second 2 +.nr first\\second 3 +.nr first\esecond 4 +\n[first] \n[second] \n[first\\second] +.PP +.rr first\esecond +\n[first] \n[second] \n[first\\second] +.PP +.rr first\\second +\n[first] \n[second] \n[first\\second] diff --git a/regress/usr.bin/mandoc/roff/nr/escname.out_ascii b/regress/usr.bin/mandoc/roff/nr/escname.out_ascii new file mode 100644 index 00000000000..facc3fd1fda --- /dev/null +++ b/regress/usr.bin/mandoc/roff/nr/escname.out_ascii @@ -0,0 +1,17 @@ +NR-ESCNAME(1) OpenBSD Reference Manual NR-ESCNAME(1) + + + +NNAAMMEE + nr-escname - escape sequences in register names + +DDEESSCCRRIIPPTTIIOONN + 1 2 3 + + 0 2 3 + + 0 2 0 + + + +OpenBSD June 29, 2014 NR-ESCNAME(1) |