diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-17 01:13:38 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-17 06:12:11 -0600 |
commit | b2201256d1c5e49d6b7659b188e113e293f1c48e (patch) | |
tree | 69d53e3298affd6831201cf3a00b7623343b9472 /HACKING | |
parent | 668a1b183b748473e2fec17bdde4db286129f659 (diff) | |
download | groff-git-b2201256d1c5e49d6b7659b188e113e293f1c48e.tar.gz |
[ms]: Port a test to Solaris 11 sed.
* tmac/tests/s_TC-works-with-percent-in-custom-titles.sh: Put newlines
after opening braces in sed scripts. macOS and GNU sed tolerate their
absence, but this sed does not.
* HACKING: Document this problem.
Diffstat (limited to 'HACKING')
-rw-r--r-- | HACKING | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -113,6 +113,8 @@ Here are some portability notes on writing automated tests. as follows. sed -n '/Foo\./{n;s/^$/FAILURE/;p;}' + But see below regarding the opening braces. + * POSIX doesn't say that sed has to accept semicolons as command separators after label (':') and branch ('t') commands, or after brace commands, so macOS sed doesn't. GNU sed does. @@ -125,12 +127,26 @@ Here are some portability notes on writing automated tests. -e 's/.*/SUCCESS/;:A;' \ -e 'p;}') + But see below regarding the opening braces. + Similarly, a brace sequence like that in this partial sed script: /f1/p}}}}}} - must be rewritten as follows. + must be rewritten as follows (or with '-e' expressions). /f1/p;} } } } } } + +* macOS and GNU sed don't require newlines (or '-e' expression endings) + after _opening_ braces, but Solaris 11 sed does. + + So the sed script + /i/{N;/Table of Contents/{N;/Foo[. ][. ]*1/p;};} + must be rewritten as follows (or with '-e' expressions). + /i/{ + N;/Table of Contents/{ + N;/Foo[. ][. ]*1/p; + }; + } |