Skip to content

ed: w! command should not update saved filename #924

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

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Jan 20, 2025

  • I found that the "w !CMD" case had the same problem as "r !CMD"; avoid updating $RememberedFilename when writing lines from buffer to an external command thru a pipe
  • Now init_pipe() takes an extra WriteFlag argument so edWrite() can use it too
  • For consistency add illegal_file() check in edWrite() before output file is opened
  • Also add quotewords() in edPipe() to allow system() to be passed an argument list
  • test1: 1,2w !rev --> pipe buffer lines 1-2 into rev command
  • test2: $w .. --> illegal_file() == TRUE
  • test3: !cc secret.c --> build secret project file

* I found that the "w !CMD" case had the same problem as "r !CMD"; avoid updating $RememberedFilename when writing lines from buffer to an external command thru a pipe
* Now init_pipe() takes an extra WriteFlag argument so edWrite() can use it too
* For consistency add illegal_file() check in edWrite() before output file is opened
* Also add quotewords() in edPipe() to allow system() to be passed an argument list
* test1: "1,2w !rev" --> pipe buffer lines 1-2 into rev command
* test2: "$w .." --> illegal_file() == TRUE
* test3: "!cc secret.c" --> build secret project file
@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 Jan 20, 2025
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing January 20, 2025 01:28 — with GitHub Actions Inactive
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12859195685

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.389%

Totals Coverage Status
Change from base Build 12854345631: 0.0%
Covered Lines: 353
Relevant Lines: 481

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jan 20, 2025

Pull Request Test Coverage Report for Build 12859195684

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.389%

Totals Coverage Status
Change from base Build 12854345631: 0.0%
Covered Lines: 353
Relevant Lines: 481

💛 - Coveralls

@briandfoy briandfoy self-assigned this Jan 20, 2025
@briandfoy briandfoy added Type: bug an existing feature does not work and removed Type: enhancement improve a feature that already exists labels Jan 20, 2025
@briandfoy briandfoy merged commit 1ff8462 into briandfoy:master Jan 20, 2025
22 of 23 checks passed
@briandfoy
Copy link
Owner

changes: w! does nut update the saved filename

@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Jan 20, 2025
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Feb 6, 2025
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: bug an existing feature does not work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants