Skip to content

Conversation

@LoukasPap
Copy link

Fix issue 253

  • Initialize the context of the hold space to \n (newline character)
  • Previously, it started as an empty string which resulted to wrong outputs

The solution fixes the problem for the swap pattern x but also for g and G.

@github-actions
Copy link

GNU sed testsuite comparison:

Test results comparison:
  Current:   TOTAL: 64 / PASSED: 8 / FAILED: 56 / SKIPPED: 0
  Reference: TOTAL: 64 / PASSED: 8 / FAILED: 56 / SKIPPED: 0

@dspinellis
Copy link
Collaborator

Please fix the failing tests, ensuring the output is compatible with existing sed output. Also ensure and test that the behavior is correct under --separate.

Probably best to wait for the integration of this PR and then add the code in the following block.

        if index == 0 || context.separate {
            context.line_number = 0;
            reset_latched_address_ranges(&mut context.range_commands);
        }

@LoukasPap
Copy link
Author

LoukasPap commented Jan 21, 2026

Yes, I'll get back on this when the PR is accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

handles multiple exchange commands differently from GNU (pattern space truncation)

2 participants