diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-12-18 15:28:28 +0100 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-12-18 15:28:28 +0100 |
commit | 40676b37c8320ae708ec4303af0ea2a649ec74d7 (patch) | |
tree | e72bcb83ef67f138c2539e6bc8fade62276bbc3b /src/b_alias_register.c | |
parent | nomergethislol (diff) | |
download | 42-minishell-40676b37c8320ae708ec4303af0ea2a649ec74d7.tar.gz 42-minishell-40676b37c8320ae708ec4303af0ea2a649ec74d7.tar.bz2 42-minishell-40676b37c8320ae708ec4303af0ea2a649ec74d7.tar.xz 42-minishell-40676b37c8320ae708ec4303af0ea2a649ec74d7.tar.zst 42-minishell-40676b37c8320ae708ec4303af0ea2a649ec74d7.zip |
spammingnormcommits
Diffstat (limited to '')
-rw-r--r-- | src/b_alias_register.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/b_alias_register.c b/src/b_alias_register.c index 8f75e36..0170a59 100644 --- a/src/b_alias_register.c +++ b/src/b_alias_register.c @@ -31,14 +31,16 @@ static void b_cpy_alias(char name[], char *ptr, char value[]) rptr++; tmp = *(rptr + ft_strlen(name)); *(rptr + ft_strlen(name)) = C_NUL; - if (ft_strncmp(rptr, name, ft_strlen(name) + 1) == 0) { + if (ft_strncmp(rptr, name, ft_strlen(name) + 1) == 0) + { *(rptr + ft_strlen(name)) = tmp; ft_strlcpy(value, ptr, ARG_MAX); ft_memmove(value + (rptr - ptr) + 1, value + (rptr - ptr), ft_strlen(value + (rptr - ptr)) + 1); *(value + (rptr - ptr)) = C_BACKS; } - else { + else + { *(rptr + ft_strlen(name)) = tmp; ft_strlcpy(value, ptr, ARG_MAX); } @@ -63,5 +65,3 @@ void b_register_arg(const char arg[], t_msh *msh) u_set_alias_value(name, value, msh); } } - - |