export et autre

This commit is contained in:
2024-04-21 23:54:15 +02:00
parent a42ddc1955
commit 51934faa06
8 changed files with 80 additions and 60 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
/* Updated: 2024/04/18 20:57:35 by marde-vr ### ########.fr */
/* Updated: 2024/04/21 20:22:09 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -58,12 +58,10 @@ int set_echoctl(int value)
struct termios t_p;
//ft_printf("echoctl value : %d\n",value);
if(!isatty(1))
return(0);
if (tcgetattr(1, &t_p))
{
//fprintf(stderr, "minishell: an error occured while getting the local fl\
//ags\n");
return (1);
}
if (((t_p.c_lflag & ECHOCTL) != 0) == value)
return (0);
//ft_printf("change\n");
@ -72,11 +70,7 @@ int set_echoctl(int value)
else
t_p.c_lflag = t_p.c_lflag & (~ECHOCTL);
if (tcsetattr(1, TCSANOW, &t_p))
{
//fprintf(stderr, "minishell: an error occured while setting the local fl\
//ags\n");
return (1);
}
return (0);
}