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

Support POSIX.1-2024 read built-in behavior (except byte-wise field splitting) #123

Merged
merged 2 commits into from
Mar 8, 2025

Conversation

magicant
Copy link
Owner

@magicant magicant commented Mar 2, 2025

This pull request includes several updates to the read built-in functionality, documentation, and translation files, as well as some minor updates to the source code files.

Updates to read built-in functionality and documentation:

  • NEWS, NEWS.ja: The read built-in now returns more specific exit statuses and supports the -d option for specifying a delimiter character. [1] [2]
  • doc/_read.txt, doc/ja/_read.txt: Updated syntax and description to include the new -d option and detailed the new exit statuses for the read built-in. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Code changes for read built-in:

  • input.c, input.h: Added support for reading input until a specified delimiter character is found, including new function read_input_delimited. [1] [2] [3] [4] [5] [6] [7] [8]

Translation updates:

Minor updates:

  • input.c, input.h: Updated copyright year to 2025. [1] [2]

These changes enhance the read built-in by adding new functionality and improving documentation and translations, ensuring better support and usability.

POSIX.1-2024 defines the exit status of the read built-in more
specifically. This commit implements the new exit statuses as follows:

- The exit status is 0 if the read built-in successfully reads a line.
- If the end of the input is reached, the exit status is 1.
- If the variables are read-only, the exit status is 2.
- If the standard input is unreadable, the exit status is 3.
- In case of a command line syntax error, the exit status is 4.
@magicant magicant added the enhancement New feature or request label Mar 2, 2025
@magicant magicant added this to the 2.59 milestone Mar 2, 2025
@magicant magicant self-assigned this Mar 2, 2025
@magicant magicant mentioned this pull request Feb 22, 2025
48 tasks
@magicant magicant marked this pull request as ready for review March 6, 2025 16:20
@magicant magicant merged commit 834ecba into trunk Mar 8, 2025
5 checks passed
@magicant magicant deleted the read branch March 8, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant