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

Fix various minor problems and update the documentation #237

Merged
merged 6 commits into from
Mar 21, 2021

Conversation

JohnoKing
Copy link

@JohnoKing JohnoKing commented Mar 21, 2021

These are minor fixes I've accumulated over time. The following changes are somewhat notable:
- Added a missing entry for typeset -s to the man page.
- Removed the man page the entry for ksh reading $PWD/.profile on login. That feature was removed in commit aa7713c.
- Added date(1) and strftime(3) to the 'see also' section of the man page.
- Note that the hash command can be used instead of alias -t to workaround one of the caveats listed in the man page.
- Use an 'out of memory' error message rather than 'out of space' when memory allocation fails (this change is to avoid grouping out of memory errors with disk space errors).
- Replaced backticks with quotes in some places for consistency.
- Added missing documentation for the %P date format.
- Added missing documentation for printf %Q and printf %p (backported from ksh2020: att#1032).
- The comments that show each builtin's options have been updated.

These are minor fixes I've accumulated over time. The following changes
are somewhat notable:
- Added a missing entry for 'typeset -s' to the man page.
- Removed the man page the entry for ksh reading $PWD/.profile on login.
  That feature was removed in commit aa7713c.
- Added date(1) to the 'see also' section of the man page.
- Note that the 'hash' command can be used instead of 'alias -t' to
  workaround one of the caveats listed in the man page.
- Use an 'out of memory' error message rather than 'out of space' when
  memory allocation fails.
- Replaced backticks with quotes in some places for consistency.
- Added missing documentation for the %P date format.
- Added missing documentation for the printf %Q and %p formats
  (backported from ksh2020: att#1032).
- The comments that show each builtin's options have been updated.
This and the date(1) addition are meant to add onto the
documentation for 'printf %T'.
@hyenias
Copy link

hyenias commented Mar 21, 2021

Just a little check yourself question: When you swapped out all the "out of space" messages to "out of memory" could there have been any instances where the "out of space" message referred to failed disk/file usage attempts? Perhaps, unable to open a file, close a file, find a file, or etc. rather than unable to allocate memory.

@JohnoKing
Copy link
Author

JohnoKing commented Mar 21, 2021

I avoided changing the error messages to "out of memory" unless the error was because of a failed memory allocation (the error messages are placed after calls like newof, getcwd and vmstrdup). In the case of REG_ESPACE it's always used after a memory allocation error, although the current pull request keeps the old name. It's not used much outside of the regex code, so I'll change that to REG_ENOMEM in the next commit.

@McDutchie
Copy link

McDutchie commented Mar 21, 2021

Please don't change the public libast API, i.e.: the name of any identifier in a header that might be included by another program. There has been some interest in possibly maintaining libast as a separate project (ping @lkujaw) and in any case we might want to compile something else against it someday.

That type of change also makes it more difficult to backport fixes (either for us, or for others who want to take some of our fixes).

If you think it's needed for clarity, you can add a brief comment to the usage of identifiers like GLOB_NOSPACE that actually refer to an out of memory condition.

The nomemory() function in init.c is a static function,
so the new name of that has been kept.
@McDutchie
Copy link

LGTM now, thanks for all this work.

@McDutchie McDutchie merged commit 814b5c6 into ksh93:master Mar 21, 2021
@JohnoKing JohnoKing deleted the new-spelling-fixes branch March 21, 2021 14:44
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