diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-08-14 18:10:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-08-14 18:10:10 +0000 |
commit | 74287fbea780d3b4119e84f8716b97ccdd161840 (patch) | |
tree | 76d544e3b7be7d15344d30e67f07932db5945fc3 /usr.bin/ul | |
parent | 5b3dcf844aa7211d6323510ef13487e744620969 (diff) |
Improve consistency of the substitution command further.
When the opening square bracket ('[') is abused as the delimiter, the regular
expression contains a bracket expression, and the bracket expression contains
another opening square bracket (sick! - i mean, sic!), then do not require
escaping that innermost bracket and treat a preceding backslash as a literal
backslash character, in accordance with POSIX:
$ printf 'x[x\\x\n' | sed 's[\[[][R[g'
xRx\x
$ printf 'x[x\\x\n' | sed 's[\[\[][R[g'
xRxRx
While here, also make the implementation more readable and insert
some comments.
Joint work with martijn@ (started during g2k18) and OK martijn@.
Diffstat (limited to 'usr.bin/ul')
0 files changed, 0 insertions, 0 deletions