Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2024 | ||
3 | ** 42sh | ||
4 | ** File description: | ||
5 | ** The file containing the multiple_commands functions | ||
6 | */ | ||
7 | /** | ||
8 | * @file multiple_commands.c | ||
9 | * @brief The file containing the multiple_commands functions | ||
10 | */ | ||
11 | |||
12 | #include "../../include/myshell.h" | ||
13 | |||
14 | /** | ||
15 | * @brief Analyse and execute multiple commands | ||
16 | * @param mysh The shell structure | ||
17 | * @param line The command line | ||
18 | * @return <b>void</b> | ||
19 | */ | ||
20 | 4718 | void analyse_multi_commands(mysh_t *mysh, char *line) | |
21 | { | ||
22 | 4718 | mysh->multi_cmds = array_separators(line, ";"); | |
23 |
2/2✓ Branch 0 taken 1048 times.
✓ Branch 1 taken 4356 times.
|
5404 | for (int index = 0; mysh->multi_cmds[index] != NULL; index++) { |
24 | 1048 | analyse_operators(mysh, mysh->multi_cmds[index]); | |
25 | } | ||
26 | 4356 | FREE_WORD_ARRAY(mysh->multi_cmds); | |
27 | 4356 | mysh->multi_cmds = NULL; | |
28 | 4356 | mysh->pipe_cmds = NULL; | |
29 | 4356 | } | |
30 |