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

process: fix interpreter support #95

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

fischerling
Copy link
Contributor

Previously, the argv array was not altered. However, this does not work when the script was executed using execp.
When executing an executable from the PATH the interpreter has no way to determine what file it should load.

Now we do the correct thing and add the path to the executed file as second argument shifting everything else to the right.

TODO: Pass the path to the interpreter as first argument.

Example

Imagine the script print_foo:

#!/bin/shell
echo foo

Previously it was only executable in the containing directory, or using an absolute path.

Now since the absolute path to the file is passed to the interpreter as second argument the shell can always use the absolute path to the script.

Previously, the argv array was not altered. However, this does not
work when the script was executed using execp.
When executing an executable from the path the interpreter has
no way to determine what file it should load.

Now we do the correct thing and add the path to the executed file
as second argument shifting everything else to the right.

TODO: Pass the path to the interpreter as first argument.
@Galfurian Galfurian merged commit ed32806 into mentos-team:develop Aug 13, 2024
18 checks passed
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