-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstr_cpy.c
More file actions
32 lines (29 loc) · 1.09 KB
/
str_cpy.c
File metadata and controls
32 lines (29 loc) · 1.09 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* str_cpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mamoussa <mamoussa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/22 11:14:55 by mamoussa #+# #+# */
/* Updated: 2020/12/10 18:04:42 by mamoussa ### ########.fr */
/* */
/* ************************************************************************** */
#include "shell.h"
void str_cpy(char **dst, char **src)
{
size_t i;
size_t j;
i = 0;
j = 0;
while (src[0][i])
{
if (src[0][i] == '~')
{
i++;
continue ;
}
dst[0][j++] = src[0][i++];
}
src[0][j] = '\0';
}