diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-12-15 23:56:22 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-12-15 23:56:22 +0000 |
commit | a3d71c17c0e33fd0519e82245eeb0d2bddede04f (patch) | |
tree | 7bc710315f412a29f427b20a62295eda0c56dae4 /regress | |
parent | 8ede708fbf4c7a28a78a4678a751f6c146bd8693 (diff) |
In quoted macro arguments, double quotes can be quoted by doubling them.
For a long time, we handle this in roff(7) and man(7) macros.
Now add correct handling for the mdoc(7) case, too.
Closely based on a patch by Tsugutomo dot ENAMI at jp dot sony dot com,
see http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=48438
received via Thomas Klausner (wiz@), slightly tweaked by me.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/mandoc/roff/args/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/args/mdoc.in | 116 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/args/mdoc.out_ascii | 31 |
3 files changed, 149 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/args/Makefile b/regress/usr.bin/mandoc/roff/args/Makefile index a5ffdd4a203..7b3bb514513 100644 --- a/regress/usr.bin/mandoc/roff/args/Makefile +++ b/regress/usr.bin/mandoc/roff/args/Makefile @@ -1,5 +1,5 @@ -# $OpenBSD: Makefile,v 1.2 2011/11/17 16:28:46 schwarze Exp $ +# $OpenBSD: Makefile,v 1.3 2013/12/15 23:56:21 schwarze Exp $ -REGRESS_TARGETS=roff man +REGRESS_TARGETS = roff man mdoc .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/roff/args/mdoc.in b/regress/usr.bin/mandoc/roff/args/mdoc.in new file mode 100644 index 00000000000..3e8593f2c37 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/args/mdoc.in @@ -0,0 +1,116 @@ +.Dd December 15, 2013 +.Dt ARGS-MDOC 1 +.Os OpenBSD +.Sh NAME +.Nm args-mdoc +.Nd arguments to mdoc macros +.Sh DESCRIPTION +standard unquoted: +.Fl one two +text +.br +escaped blanks: +.Fl one\ one two\ two +text +.br +escaped 'e' character: +.Fl one\eone two +text +.br +.\"escaped backslash before blank: +.\"Fl one\\ two +.\"text +.\"br +.\"escaped backslash before 'e' character: +.\"Fl one\\e two +.\"text +.\"br +double inter-argument space: +.Fl one two +text +.br +triple inter-argument space: +.Fl one two +text +.br +single eol blank: +.Fl one two +text +.br +double eol blank: +.Fl one two +text +.br +triple eol blank: +.Fl one two +text +.br +standard quoted: +.Fl "one" "two" +text +.br +quoted quotes: +.Fl "one""one" """two""" +text +.br +quoted whitespace: +.Fl "one one" "two two" +text +.br +escaped 'e' characters: +.Fl "one \e one" "\e" +text +.br +.\"escaped backslash before blank: +.\"Fl "one\\ one" "\\ " +.\"text +.\"br +.\"escaped backslash before 'e' character: +.\"Fl "one\\eone" "\\e" +.\"text +.\"br +double inter-argument space: +.Fl "one one" "two two" +text +.br +triple inter-argument space: +.Fl "one one" "two two" +text +.br +missing inter-argument space: +.Fl "one one"two\ two +text +.br +single eol blank: +.Fl "one one" "two two" +text +.br +double eol blank: +.Fl "one one" "two two" +text +.br +triple eol blank: +.Fl "one one" "two two" +text +.br +trailing blanks in arguments: +.Fl "one " "two " +text +.br +unterminated quotes: +.Fl "one +.Fl one "two +text +.br +single trailing blank in unterminated quotes: +.Fl "one +.Fl one "two +text +.br +double trailing blank in unterminated quotes: +.Fl "one +.Fl one "two +text +.br +backslash at eol: +.Fl one two\ diff --git a/regress/usr.bin/mandoc/roff/args/mdoc.out_ascii b/regress/usr.bin/mandoc/roff/args/mdoc.out_ascii new file mode 100644 index 00000000000..c2fcb254cc3 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/args/mdoc.out_ascii @@ -0,0 +1,31 @@ +ARGS-MDOC(1) OpenBSD Reference Manual ARGS-MDOC(1) + +NNAAMMEE + aarrggss--mmddoocc - arguments to mdoc macros + +DDEESSCCRRIIPPTTIIOONN + standard unquoted: --oonnee --ttwwoo text + escaped blanks: --oonnee oonnee --ttwwoo ttwwoo text + escaped 'e' character: --oonnee\\oonnee --ttwwoo text + double inter-argument space: --oonnee --ttwwoo text + triple inter-argument space: --oonnee --ttwwoo text + single eol blank: --oonnee --ttwwoo text + double eol blank: --oonnee --ttwwoo text + triple eol blank: --oonnee --ttwwoo text + standard quoted: --oonnee --ttwwoo text + quoted quotes: --oonnee""oonnee --""ttwwoo"" text + quoted whitespace: --oonnee oonnee --ttwwoo ttwwoo text + escaped 'e' characters: --oonnee \\ oonnee --\\ text + double inter-argument space: --oonnee oonnee --ttwwoo ttwwoo text + triple inter-argument space: --oonnee oonnee --ttwwoo ttwwoo text + missing inter-argument space: --oonnee oonnee --ttwwoo ttwwoo text + single eol blank: --oonnee oonnee --ttwwoo ttwwoo text + double eol blank: --oonnee oonnee --ttwwoo ttwwoo text + triple eol blank: --oonnee oonnee --ttwwoo ttwwoo text + trailing blanks in arguments: --oonnee --ttwwoo text + unterminated quotes: --oonnee --oonnee --ttwwoo text + single trailing blank in unterminated quotes: --oonnee --oonnee --ttwwoo text + double trailing blank in unterminated quotes: --oonnee --oonnee --ttwwoo text + backslash at eol: --oonnee --ttwwoo + +OpenBSD December 15, 2013 OpenBSD |