From c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 11 Oct 2020 15:52:52 +0200 Subject: Removing libft/minishell_test submodules, Removing subject/README/etc --- libft/src/dstr/ft_dstrunwrap.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 libft/src/dstr/ft_dstrunwrap.c (limited to 'libft/src/dstr/ft_dstrunwrap.c') diff --git a/libft/src/dstr/ft_dstrunwrap.c b/libft/src/dstr/ft_dstrunwrap.c new file mode 100644 index 0000000..5b29b5b --- /dev/null +++ b/libft/src/dstr/ft_dstrunwrap.c @@ -0,0 +1,28 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_dstrunwrap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/03 13:59:35 by charles #+# #+# */ +/* Updated: 2020/04/04 19:58:41 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_dstr.h" + +/* +** \brief Destroy dynamic string but keep the underlying static string +** \param dstr Dynamic string to unwrap +** \return Underlying string of the dynamic one +*/ + +char *ft_dstrunwrap(t_ftdstr *dstr) +{ + char *tmp; + + tmp = dstr->str; + free(dstr); + return (tmp); +} -- cgit