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

Adds handling of >> and << redirections. #28

Merged
merged 9 commits into from
Jul 16, 2024

Conversation

Haliris
Copy link
Owner

@Haliris Haliris commented Jul 16, 2024

Minishell can now handle here_doc and append redirections properly..

Added here_doc utils function in main and here_doc_utils.c files to duplicate adresses to the here_doc files path and unlink() them after execution.

Parser now distributes TK_PARS_APPEND tokens to files that need to be appended, no change in logic for here_doc, they are treated the same as normal files.

Jean Teissier and others added 9 commits July 15, 2024 19:14
…TER the execution processes are done. Also fixed bad parsing of heredoc tokens. Execution does not work, it receives a bad file descriptor
…hild can now reopen it, modified parser logic and execution logic to reflect that change. added protection to parser_clean exit logic to avoid calling free on the heredoc path.
… and unlink functions. Append does not work sometimes, yet to be traced
…preference to the >> operator due to strncmp stopping too early for shorter strings
@Haliris
Copy link
Owner Author

Haliris commented Jul 16, 2024

Spotted a bug with <<, do not merge

@Haliris Haliris added Do not merge Something isn't working and removed Ready for merge labels Jul 16, 2024
@Haliris
Copy link
Owner Author

Haliris commented Jul 16, 2024

Wait no I am dumb, I was testing on main

@Haliris Haliris added Ready for merge and removed Do not merge Something isn't working labels Jul 16, 2024
Copy link
Collaborator

@BenjaminHThomas BenjaminHThomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BenjaminHThomas BenjaminHThomas merged commit 97b3c6b into main Jul 16, 2024
4 checks passed
@Haliris Haliris deleted the exec_redirection_improvements branch July 16, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants