Skip to content

Factor out posix_spawnp(3)/waitpid(2) calls to a new function#57

Merged
ac000 merged 1 commit into
masterfrom
open_editor
Jun 24, 2026
Merged

Factor out posix_spawnp(3)/waitpid(2) calls to a new function#57
ac000 merged 1 commit into
masterfrom
open_editor

Conversation

@ac000

@ac000 ac000 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

There are several places where we do a posix_spawnp(3) followed by a waitpid(2) to open a text editor to edit some JSON.

Factor these sites out into their own function, open_editor().

Assisted-by: GitHub Copilot:claude-opus-4.5

Copilot AI review requested due to automatic review settings June 24, 2026 16:20
Comment thread src/itsa.c Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors repeated posix_spawnp(3) + waitpid(2) sequences used to open a text editor for JSON edits into a shared open_editor() helper, reducing duplication across multiple interactive flows in itsa.

Changes:

  • Introduces get_editor()/open_editor() helpers and reuses them across editor-invoking sites.
  • Removes duplicated inline spawn/wait logic from annual_summary, trigger_bsas, and amend_savings_account.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/itsa.c
There are several places where we do a posix_spawnp(3) followed by a
waitpid(2) to open a text editor to edit some JSON.

Factor these sites out into their own function, open_editor().

Assisted-by: GitHub Copilot:claude-opus-4.5
Signed-off-by: Andrew Clayton <ac@sigsegv.uk>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@ac000 ac000 merged commit d5a7a53 into master Jun 24, 2026
10 checks passed
@ac000 ac000 deleted the open_editor branch June 24, 2026 16:41
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.

3 participants