Skip to content

Change false, pwd, and true to substitutive built-ins #96

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

Closed
Tracked by #84
magicant opened this issue Dec 22, 2024 · 3 comments · Fixed by #124
Closed
Tracked by #84

Change false, pwd, and true to substitutive built-ins #96

magicant opened this issue Dec 22, 2024 · 3 comments · Fixed by #124
Labels
good first issue Good for newcomers

Comments

@magicant
Copy link
Owner

magicant commented Dec 22, 2024

POSIX.1-2024 removed the three utilities from the list of utilities that are always found regardless of PATH. To reflect this change, we need to change their type from "mandatory" to "substitutive". The built-in types are defined in builtin.h and builtin.c.

@magicant magicant added the good first issue Good for newcomers label Dec 22, 2024
@c0d3-br3ak9r
Copy link
Contributor

I'd like to work on this!

@c0d3-br3ak9r
Copy link
Contributor

I've replaced the definitions for these commands from BI_MANDATORY to BI_SUBSTITUTIVE in builtin.c. But I have some doubts regarding the tests.

Is it fine to remove the tests for these commands from builtins-p.tst and command-y.tst? And do they need to be added elsewhere?
Also in command-p.tst, false is being used to test command ignores function (mandatory built-in)? Should we replace it with other command?

@magicant
Copy link
Owner Author

magicant commented Mar 3, 2025

Hi,

Here is a summary of expected updates in the tests:

  • In builtins-p.tst:
    • The tests generated by the test_nonspecial_builtin_function_override function should be left as is.
    • The test cases intrinsic built-in {...} can be invoked without $PATH should be removed for the three built-ins.
  • In command-y.tst:
    • The three built-ins should be removed from the test case describing mandatory built-ins (-V). Instead, they should be added to the test case describing substitutive built-in (-V).
  • In command-p.tst:
    • The test case command ignores function (mandatory built-in) should be updated to use another mandatory built-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants