Skip to content

stdio: fix fgets(), add gets()#473

Open
julianuziemblo wants to merge 1 commit into
masterfrom
julianuziemblo/#1489
Open

stdio: fix fgets(), add gets()#473
julianuziemblo wants to merge 1 commit into
masterfrom
julianuziemblo/#1489

Conversation

@julianuziemblo
Copy link
Copy Markdown
Contributor

@julianuziemblo julianuziemblo commented May 8, 2026

Fixes: phoenix-rtos/phoenix-rtos-project#1489

Description

Motivation and Context

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)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: ia32-generic-qemu

Checklist:

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the gets stub from posix/stubs.c and provides a functional implementation in stdio/file.c. The implementation introduces a static helper _fgets to share logic between fgets_unlocked and the new gets function, which now correctly handles locking on stdin. I have no feedback to provide as there were no review comments to evaluate.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Unit Test Results

10 631 tests   9 961 ✅  52m 34s ⏱️
   649 suites    670 💤
     1 files        0 ❌

Results for commit 469a10e.

♻️ This comment has been updated with latest results.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/#1489 branch from 8c3af92 to fb9fffb Compare May 8, 2026 11:49
@julianuziemblo julianuziemblo requested a review from etiaro May 8, 2026 11:59
Copy link
Copy Markdown
Member

@nalajcie nalajcie left a comment

Choose a reason for hiding this comment

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

Adding multiple people before even the test were run (and failed)? Please be more mindful to the potential reviewers,

Comment thread stdio/file.c Outdated
@julianuziemblo julianuziemblo marked this pull request as draft May 8, 2026 13:27
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/#1489 branch from fb9fffb to d95659e Compare May 11, 2026 07:42
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/#1489 branch 2 times, most recently from 578643c to 1a2af56 Compare May 14, 2026 13:30
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/#1489 branch from 1a2af56 to 469a10e Compare May 21, 2026 13:24
@julianuziemblo julianuziemblo marked this pull request as ready for review May 22, 2026 07:51
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.

fgets() behavior and implementation diverges from ISO C standard

2 participants