Norihiro Tanaka 4c75f64068 sed: fix mishandling of overlapping address ranges
When the line number ranges of two or more editing commands overlap,
sed applies all commands but the first to a line that is just beyond
the union of all ranges.  E.g., with this command,
seq 9|sed '2,7d;3,6d', sed would mistakenly delete line 8.

* sed/execute.c (match_an_address_p) [ADDR_IS_NUM]: Make this
function work also in this case.
(match_address_p): Move the ADDR_IS_NUM +
...->line_number == ...->addr_number comparison "up" into
match_an_address_p, so we can hoist two similar if/return
blocks out of "if" and "else" branches.
Change so that this function returns false when the current
line number is outside the specified range.
* testsuite/range-overlap.sh: New file, to test for this.
* testsuite/Makefile.am (T): Add it to the list.
* NEWS (Bug fixes): Mention it.
Reported as http://bugs.gnu.org/19899
2015-05-06 19:18:54 -07:00
2015-05-01 18:09:51 -07:00
2014-11-30 18:59:33 -08:00
2008-04-10 11:14:38 +02:00
2014-11-30 18:59:33 -08:00
2014-11-30 18:59:33 -08:00
2004-10-20 21:42:31 +00:00
2015-05-01 18:09:51 -07:00
2015-05-01 18:09:51 -07:00
2014-11-30 18:59:32 -08:00

This is the GNU implementation of sed, the Unix stream editor.

See the NEWS file for a brief summary and the ChangeLog for
more detailed descriptions of changes.

See the file INSTALL for generic compilation and installation
instructions.

See the file BUGS for instructions about reporting bugs.

The file README.boot gives instructions for making a "bootstrap"
version of sed on systems which lack any pre-existing and working
version of sed.
S
Description
SED (stream editor) - неинтерактивный текстовый редактор командной строки
https://www.gnu.org/software/sed/
Readme GPL-3.0
3 MiB
0 Stars 1 Watchers 0 Forks
Languages
Shell 43%
C 26.4%
Perl 16.5%
sed 7.3%
Makefile 5.2%
Other 1.6%