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

rm: can't delete a filename including a dash #669

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Jul 17, 2024

  • A filename starting with a dash can be given as an argument like this: ./-o-
  • The cp program seems to support this but rm does not (see below)
  • I also tested a file called a-b
  • Debugging showed that preprocessed_args is incorrectly ['-c','-p','-.','-1']
  • Stepping through preprocess_options() revealed a regex on L146 which was not bound to the start of the string
%perl cp cp ./-cp.1
%perl rm ./-cp.1 
Unknown option: c
Unknown option: p
Unknown option: .
Unknown option: 1
Usage: rm [-fiPrRv] file ...

* A filename starting with a dash can be given as an argument like this: ./-o-
* The cp program seems to support this but rm does not (see below)
* I also tested a file called a-b
* Debugging showed that preprocessed_args is incorrectly ['-c','-p','-.','-1']
* Stepping through preprocess_options() revealed a regex on L146 which was not bound to the start of the string

%perl cp cp ./-cp.1
%perl rm ./-cp.1 
Unknown option: c
Unknown option: p
Unknown option: .
Unknown option: 1
Usage: rm [-fiPrRv] file ...
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: rm The rm program labels Jul 17, 2024
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing July 17, 2024 13:34 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Jul 17, 2024

Pull Request Test Coverage Report for Build 9975239182

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 77.016%

Totals Coverage Status
Change from base Build 9959948277: 0.0%
Covered Lines: 382
Relevant Lines: 496

💛 - Coveralls

@briandfoy briandfoy self-assigned this Jul 17, 2024
@briandfoy briandfoy merged commit 9939398 into briandfoy:master Jul 17, 2024
23 checks passed
@briandfoy
Copy link
Owner

changes: fix option processing so a filename containing a dash is not included.

@briandfoy briandfoy removed the Type: enhancement improve a feature that already exists label Jul 17, 2024
@briandfoy briandfoy added Type: bug an existing feature does not work Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Jul 17, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: rm The rm 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