Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed: simplify edEdit() #459

Merged
merged 1 commit into from
Feb 13, 2024
Merged

ed: simplify edEdit() #459

merged 1 commit into from
Feb 13, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Feb 13, 2024

  • edEdit() handles both "r Filename" and "w Filename"; "w" replaces entire line buffer
  • $chars is the number of bytes read into the buffer from the file
  • Use $chars directly as the byte count instead of copying the value from $tmp_chars (reduce confusion)
  • Variable tmp_lines2 also gets removed
  • Return 0 for failure as advertised at top of edEdit()
  • Change remaining regex to eq in command interpreter for consistency

* edEdit() handles both "r Filename" and "w Filename"; "w" replaces entire line buffer
* $chars is the number of bytes read into the buffer from the file
* Use $chars directly as the byte count instead of copying the value from $tmp_chars (reduce confusion)
* Variable tmp_lines2 also gets removed
* Return 0 for failure as advertised at top of edEdit()
* Change remaining regex to eq in command interpreter for consistency
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: ed The ed program labels Feb 13, 2024
Copy link
Owner

@briandfoy briandfoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes.

@briandfoy briandfoy merged commit fe33133 into briandfoy:master Feb 13, 2024
2 checks passed
@briandfoy briandfoy added the Status: accepted The fix is accepted label Feb 13, 2024
@briandfoy briandfoy removed the Priority: low get to this whenever label Feb 13, 2024
@briandfoy briandfoy self-assigned this Feb 14, 2024
@briandfoy
Copy link
Owner

changes: improvements to r filename and w filename

@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: ed The ed program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants