Skip to content

Conversation

@naoNao89
Copy link
Contributor

removes three unwrap() calls that could cause panics, ensuring stdbuf properly handles errors according to GNU specification

According to GNU stdbuf documentation:

Exit status:

  • 125 if stdbuf itself fails
  • 126 if command is found but cannot be invoked
  • 127 if command cannot be found
  • the exit status of command otherwise

- Replace get_many().unwrap() with ok_or_else() to handle missing command
- Replace next().unwrap() with pattern matching for safety
- Replace tempdir().unwrap() with map_err() to handle temp dir failures

All stdbuf internal errors now properly exit with code 125 per GNU specification:
https://www.gnu.org/s/coreutils/manual/html_node/stdbuf-invocation.html
@naoNao89 naoNao89 force-pushed the fix/stdbuf-remove-unwrap branch from 2bd8811 to e0c7ef7 Compare November 21, 2025 01:05
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/fold/fold is no longer failing!

@sylvestre sylvestre merged commit 7c1a25a into uutils:main Nov 21, 2025
127 checks passed
@naoNao89 naoNao89 deleted the fix/stdbuf-remove-unwrap branch November 21, 2025 05:18
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.

2 participants