No description
Find a file
Khaïs COLIN dff5de66da
fix redirection parsing sometimes skipping over redirections
This happens when multiple redirections are following each others, such as in

	 echo hi > out < in

which would be parsed as

 ╰─ t_cmdgroup
     ├─ t_cmdlist
     │   ├─ num_cmds = 1
     │   ╰─ cmd[0]
     │       ├─ t_cmdlist_item
     │       │   ╰─ t_pipeline
     │       │       ├─ num_cmd = 1
     │       │       ╰─ cmd[0]
     │       │           ╰─ t_simple_cmd
     │       │               ├─ words = [echo][hi][<][in]
     │       │               ╰─ t_redir_list
     │       │                   ╰─ redirection[0]
     │       │                       ╰─ t_redirection
     │       │                           ├─ t_redir_type = REDIR_OUTPUT
     │       │                           ╰─ marker = [out]
     │       ╰─ t_operator = END
     ╰─ (no redirections)

when the correct parsing is
 ╰─ t_cmdgroup
     ├─ t_cmdlist
     │   ├─ num_cmds = 1
     │   ╰─ cmd[0]
     │       ├─ t_cmdlist_item
     │       │   ╰─ t_pipeline
     │       │       ├─ num_cmd = 1
     │       │       ╰─ cmd[0]
     │       │           ╰─ t_simple_cmd
     │       │               ├─ words = [echo][hi]
     │       │               ╰─ t_redir_list
     │       │                   ├─ redirection[0]
     │       │                   │   ╰─ t_redirection
     │       │                   │       ├─ t_redir_type = REDIR_OUTPUT
     │       │                   │       ╰─ marker = [out]
     │       │                   ╰─ redirection[1]
     │       │                       ╰─ t_redirection
     │       │                           ├─ t_redir_type = REDIR_INPUT
     │       │                           ╰─ marker = [in]
     │       ╰─ t_operator = END
     ╰─ (no redirections)
2025-03-28 14:50:37 +01:00
libft debug: remove *alloc/free debug information 2025-03-10 13:22:29 +00:00
src fix redirection parsing sometimes skipping over redirections 2025-03-28 14:50:37 +01:00
tests refactor cmdlist.num_cmds -> cmdlist.num_cmd to be more consistent 2025-03-28 14:50:37 +01:00
.gitignore tests: implement a better integration test framework than shellspec 2025-03-28 14:50:37 +01:00
.valgrindrc valgrind: suppress readline still reachable leaks 2025-02-07 15:29:43 +01:00
interesting_tests.md Expansion : text replacement in a string 2025-03-21 10:04:25 +01:00
Makefile redirection parsing: parse redirections for cmdgroup 2025-03-28 14:50:37 +01:00
NOTES.md cmdlist: use new architecture (STUB) 2025-03-28 14:50:37 +01:00
readline.supp valgrind: suppress readline still reachable leaks 2025-02-07 15:29:43 +01:00
test.sh fix redirection parsing sometimes skipping over redirections 2025-03-28 14:50:37 +01:00