I have an array of double pointers where each string represents a path.

I would like to add a “/” at the end of each path in my array so that I can then execute them in my program, but I'm having trouble designing the loop.

Any ideas ?

[Scheme](https://i.stack.imgur.com/CAsjH.jpg)

Here is my way of doing it for the moment but as you can see it is not at all optimal...

```c
char    **ft_extract_and_delimit_path(char **envp)
{
    char    **array_of_paths;
    int     i;
    int     j;

    array_of_paths = NULL;
    i = 0;

    while(ft_strnstr(envp[i], "PATH", 4) == 0)
        i++;

    array_of_paths = ft_split(envp[i] + 5, ':');

    i = 0;
    j = 0;

    while (array_of_paths[i][j] != '\0')
        j++;
    array_of_paths[i][j] = ft_strjoin(array_of_paths[j], "/");

    i++;
    j = 0;

    while (array_of_paths[i][j] != '\0')
        j++;
    array_of_paths[i][j] = ft_strjoin(array_of_paths[j], "/");

    i++;
    j = 0;

    while (array_of_paths[i][j] != '\0')
        j++;
    array_of_paths[i][j] = ft_strjoin(array_of_paths[j], "/");

    i++;
    j = 0;

    ...
}

```