Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yabtaour
GitHub Repository: yabtaour/Minishell-42
Path: blob/main/execution/my_mess/heredoc_utils.c
1407 views
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* heredoc_utils.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: ssabbaji <[email protected]> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/10/02 10:55:33 by ssabbaji #+# #+# */
9
/* Updated: 2022/10/07 14:27:35 by ssabbaji ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "../../minishell.h"
14
15
int check_delim_idx(t_data *data, t_cmd *cmd)
16
{
17
if (cmd->prev)
18
data->general.index += cmd->prev->her_doc_num;
19
return (data->general.index);
20
}
21
22
void print_her_in(t_cmd *cmd, char *here_buff)
23
{
24
ft_putstr_fd(here_buff, cmd->her_in);
25
ft_putstr_fd("\n", cmd->her_in);
26
free(here_buff);
27
}
28
29