-
Notifications
You must be signed in to change notification settings - Fork 0
/
ms_print_export.c
41 lines (38 loc) · 1.36 KB
/
ms_print_export.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ms_print_export.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: obeedril <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/11 20:54:56 by obeedril #+# #+# */
/* Updated: 2022/03/11 20:56:03 by obeedril ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void ms_print_sort_export(t_data *data, int y)
{
int x;
char qm_d;
x = 0;
qm_d = DOUBLE_Q_MARK;
write(1, "declare -x ", 12);
while (data->our_env[y][x] != '=' && data->our_env[y][x] != '\0')
{
write(1, &data->our_env[y][x], 1);
x++;
}
if (data->our_env[y][x] != '\0')
{
write(1, "=", 1);
x++;
write(1, &qm_d, 1);
while (data->our_env[y][x] != '\0')
{
write(1, &data->our_env[y][x], 1);
x++;
}
write(1, &qm_d, 1);
}
write(1, "\n", 1);
}