You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sed - addr,~N range stays open when its end line never reaches the command #655
An addr,~N range should end at the first line after addr whose number is a multiple of N.
uutils sed only closes the range when the command is actually evaluated on a multiple of N. If
that line is skipped (by an earlier d, a branch, n/N, or an enclosing block), the range
stays open until the next multiple of N, or the end of input.
The range 2,~3 should end on line 3. Line 3 is deleted before it reaches p. GNU closes the
range on the next line the command sees (line 4, which is still printed); uutils sed keeps it
open until line 6.
Root cause
The StepEnd arm of applies() in src/sed/processor.rs:110-116:
Address::StepEnd(step) => {// Inclusive end on multiple of stepif linenum.is_multiple_of(*step){
command.start_line = None;}Ok(true)}
It ignores start (the line where the range began) and only tests the current line number.
Activity