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 variable expansion on expressions. #107

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Krush206
Copy link

It's known variables expand earlier than expression evaluations. The procedure

if ( $?a && "$a" != ) echo "$a"

would fail if a isn't set. The correct behavior is to evaluate $?a first, and, if expanded to zero, cancel further processing.

This work remedies the issue by postponing variable expansions during expression evaluations. The function Dfix1 is used for I/O redirections, and fails if the expansion is null or, if not quoted, larger than one word/vector. I believe this behavior is fine.

This work was also supposed to fix $< expansions on pipes and redirections. I had some success with a fix, but ends up blocking the shell, making it unusable and uninterruptible.

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.

1 participant