Skip to content

Conversation

@mknos
Copy link
Contributor

@mknos mknos commented Feb 26, 2025

  • Make more of an effort to reject patches where line addresses are not valid
  • Reading over the ed command parser in Patch::Ed::apply(), the regex assignment was not always correct
  • test1: invalid command "19,0d" was incorrectly interpreted as (valid) "19,19d" thanks to the '||' operator
  • test2: "19,18d" command was accepted, but the range is backwards
  • test3: "0,19d" command was accepted, but address 0 is not allowed for "d"
  • test4: "0,19c" command was accepted, but address 0 is not allowed for "c"
  • I tested this by skipping to PLAN_J, using a diff with an update on line1 (ed command 0a is valid and means append after line 0)
  • Modifying elements of the diff input, I could trigger the new validation errors
%perl diff -e env env2 | perl tee env.diff # original test input
19,20d
5,8c
META DATA
AND MORE
.
0a
#NEW LINE 1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.

* Make more of an effort to reject patches where line addresses are not valid
* Reading over the ed command parser in Patch::Ed::apply(), the regex assignment was not always correct
* test1: "19,0d" command was incorrectly interpreted as "19,19d" thanks to the '||' operator
* test2: "19,18d" command was accepted, but the range is backwards
* test3: "0,19d" command was accepted, but address 0 is not allowed for "d"
* test4: "0,19c" command was accepted, but address 0 is not allowed for "c"
* I tested this by skipping to PLAN_J, using a modified diff with an update on line1 (ed command 0a is valid and means append after line 0)
* Modifying elements of the diff input, I could trigger the new validation errors

%perl diff -e env env2 | perl tee env.diff
19,20d
5,8c
META DATA
AND MORE
.
0a
#NEW LINE 1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@github-actions github-actions bot added the Priority: low get to this whenever label Feb 26, 2025
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@github-actions github-actions bot added the Status: needs verification issue needs to be verified label Feb 26, 2025
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@github-actions github-actions bot added Type: bug an existing feature does not work Priority: low get to this whenever labels Feb 26, 2025
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@github-actions github-actions bot added the Status: needs verification issue needs to be verified label Feb 26, 2025
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@github-actions github-actions bot added the Type: bug an existing feature does not work label Feb 26, 2025
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Program: patch The patch program labels Feb 26, 2025
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:19 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 26, 2025 03:20 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Feb 26, 2025

Pull Request Test Coverage Report for Build 13535808664

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 72.349%

Totals Coverage Status
Change from base Build 13523294333: -0.7%
Covered Lines: 348
Relevant Lines: 481

💛 - Coveralls

@briandfoy
Copy link
Owner

changes: reject patches where the range is not valid

@briandfoy briandfoy self-assigned this Feb 26, 2025
@briandfoy briandfoy merged commit 1f404df into briandfoy:master Feb 26, 2025
23 of 24 checks passed
@github-actions github-actions bot added Status: accepted The fix is accepted and removed Status: needs verification issue needs to be verified Priority: low get to this whenever labels Feb 26, 2025
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Program: patch The patch program Status: released there is a new release with this fix Type: bug an existing feature does not work Type: enhancement improve a feature that already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants