mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
fix(debug): correctly print here_doc_eof in redirect debug
This commit is contained in:
parent
38ffac7fc3
commit
bf26afce2b
2 changed files with 64 additions and 2 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/09 15:07:58 by khais #+# #+# */
|
||||
/* Updated: 2025/04/21 10:33:06 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/22 11:41:55 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -60,8 +60,10 @@ static void single_redirect_debug(t_redirect *redirect, t_buffer *leader,
|
|||
ft_printf("c_flags = %d\n", redirect->c_flags);
|
||||
dedent(leader, false);
|
||||
redirectee_debug(redirect->redirectee, leader, false);
|
||||
indent(leader, true);
|
||||
indent(leader, false);
|
||||
ft_printf("c_flags = [%s]\n", redirect->here_doc_eof);
|
||||
dedent(leader, false);
|
||||
indent(leader, true);
|
||||
ft_printf("here_doc_eof = [%s]\n", redirect->here_doc_eof);
|
||||
dedent(leader, true);
|
||||
dedent(leader, is_last);
|
||||
|
|
|
|||
60
test.sh
60
test.sh
|
|
@ -860,4 +860,64 @@ goodbye
|
|||
0
|
||||
EOF
|
||||
|
||||
when_run <<EOF "correct parsing and debugging of multiple redirections"
|
||||
.debug
|
||||
.exec
|
||||
echo hello > outfile > outfile
|
||||
EOF
|
||||
expecting <<EOF
|
||||
[dbg: 1]
|
||||
[exec: 0]
|
||||
parsed command
|
||||
╰─ t_cmd
|
||||
├─ t_cmd_type = FT_SIMPLE
|
||||
├─ flags = 0
|
||||
├─ line = 0
|
||||
╰─ value
|
||||
╰─ t_simple_cmd
|
||||
├─ line = 0
|
||||
├─ t_wordlist
|
||||
│ ├─ t_worddesc
|
||||
│ │ ├─ word = [echo]
|
||||
│ │ ├─ marker = [ ]
|
||||
│ │ ├─ flags = 0
|
||||
│ │ ╰─ t_token_type = WORD_TOKEN
|
||||
│ ╰─ t_worddesc
|
||||
│ ├─ word = [hello]
|
||||
│ ├─ marker = [ ]
|
||||
│ ├─ flags = 0
|
||||
│ ╰─ t_token_type = WORD_TOKEN
|
||||
╰─ redirections
|
||||
├─ redirections[0]
|
||||
│ ╰─ t_redirect
|
||||
│ ├─ redir_type = FT_OUTPUT_TRUNC_REDIR
|
||||
│ ├─ source = 1
|
||||
│ ├─ open_flags = 577
|
||||
│ ├─ c_flags = 420
|
||||
│ ├─ t_redirectee
|
||||
│ │ ├─ dest = 14320
|
||||
│ │ ╰─ t_worddesc
|
||||
│ │ ├─ word = [outfile]
|
||||
│ │ ├─ marker = [ ]
|
||||
│ │ ├─ flags = 0
|
||||
│ │ ╰─ t_token_type = WORD_TOKEN
|
||||
│ ├─ c_flags = [(null)]
|
||||
│ ╰─ here_doc_eof = [(null)]
|
||||
╰─ redirections[1]
|
||||
╰─ t_redirect
|
||||
├─ redir_type = FT_OUTPUT_TRUNC_REDIR
|
||||
├─ source = 1
|
||||
├─ open_flags = 577
|
||||
├─ c_flags = 420
|
||||
├─ t_redirectee
|
||||
│ ├─ dest = 14608
|
||||
│ ╰─ t_worddesc
|
||||
│ ├─ word = [outfile]
|
||||
│ ├─ marker = [ ]
|
||||
│ ├─ flags = 0
|
||||
│ ╰─ t_token_type = WORD_TOKEN
|
||||
├─ c_flags = [(null)]
|
||||
╰─ here_doc_eof = [(null)]
|
||||
EOF
|
||||
|
||||
finalize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue