Skip to content

[libc] Remove stdio dependencies in linenoise lib#2417

Merged
ghaerr merged 1 commit intomasterfrom
linenoise2
Oct 22, 2025
Merged

[libc] Remove stdio dependencies in linenoise lib#2417
ghaerr merged 1 commit intomasterfrom
linenoise2

Conversation

@ghaerr
Copy link
Copy Markdown
Owner

@ghaerr ghaerr commented Oct 22, 2025

Close inspection of the linenoise library reveals it was dragging in stdio, when the primary user /bin/sh doesn't use stdio.

Replaces fgets, fgetc and fread with small internal versions. Also removes atexit() since that was only used for exit protection when in raw mode, and the library won't exit with raw mode enabled.

Some slight source code retabbing.

Saves ~400 bytes from /bin/sh compared to original size prior to linenoise library pulled into C library.

@ghaerr ghaerr merged commit 5416bc9 into master Oct 22, 2025
2 checks passed
@ghaerr ghaerr deleted the linenoise2 branch October 22, 2025 21:15
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