-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmall_fonc.c
47 lines (42 loc) · 1.33 KB
/
small_fonc.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
42
43
44
45
46
47
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* small_fonc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jraymond <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/15 01:41:45 by jraymond #+# #+# */
/* Updated: 2018/05/16 19:14:47 by jraymond ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_ls.h"
int is_empty(t_btree *root, int i)
{
if (((t_finfo *)root->ptrdata)->name[0] != '.')
i++;
if (root->left)
i = is_empty(root->left, i);
if (root->right)
i = is_empty(root->right, i);
return (i);
}
int ft_strofpoint(char *str)
{
while (*str)
{
if (*str != '.')
return (-1);
str++;
}
return (0);
}
char *tname_file(char *str)
{
char *tmp;
while ((str = ft_strchr(str, '/')))
{
str++;
tmp = str;
}
return (tmp);
}