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

psh: fix passing double dash to history, mem and echo #155

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

damianloew
Copy link
Contributor

@damianloew damianloew commented Oct 5, 2022

Description

  • psh: echo: fix passing double dash
  • psh: mem: fix passing double dash
  • psh: history: fix passing double dash

Motivation and Context

  • before:
    Screenshot from 2022-10-06 16-42-40

  • after:
    Screenshot from 2022-10-06 16-47-07

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@damianloew damianloew changed the title Damianloew/psh fix double dash psh: fix passing double dash to history, mem and echo Oct 5, 2022
@@ -90,8 +90,8 @@ static int psh_echo(int argc, char **argv)
}
}

for (i = optind; i < argend; ++i) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Providing the only option causes early return it can be 1.

if (optind < argc) {
fprintf(stderr, "mem: unknown argument: %s\n", argv[optind]);
if (optind <= argc) {
ind = (optind == argc) ? optind - 1 : optind;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Providing the only option causes early return optind == argc will be -- case.

@damianloew damianloew marked this pull request as ready for review October 6, 2022 14:38
@damianloew damianloew requested a review from agkaminski October 6, 2022 14:48
@agkaminski agkaminski requested a review from nalajcie October 6, 2022 15:00
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.

1 participant