mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 11:26:51 +01:00
「🔨」 fix: fixed some things.
This commit is contained in:
53
readline.supp
Normal file
53
readline.supp
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
readline
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: reachable
|
||||||
|
...
|
||||||
|
fun:readline
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
readline-history
|
||||||
|
Memcheck:Leak
|
||||||
|
...
|
||||||
|
fun:xmalloc
|
||||||
|
fun:add_history
|
||||||
|
...
|
||||||
|
}
|
||||||
|
{
|
||||||
|
</bin/toe>
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: reachable
|
||||||
|
...
|
||||||
|
obj:/usr/bin/toe
|
||||||
|
fun:(below main)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
</bin/locale>
|
||||||
|
Memcheck:Leak
|
||||||
|
...
|
||||||
|
obj:/usr/bin/locale
|
||||||
|
fun:(below main)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
</bin/clear>
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: reachable
|
||||||
|
...
|
||||||
|
obj:/usr/bin/clear
|
||||||
|
fun:(below main)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
</bin/cat>
|
||||||
|
Memcheck:Leak
|
||||||
|
...
|
||||||
|
obj:/usr/bin/cat
|
||||||
|
fun:(below main)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
</bin/ls>
|
||||||
|
Memcheck:Leak
|
||||||
|
...
|
||||||
|
obj:/usr/bin/ls
|
||||||
|
fun:(below main)
|
||||||
|
}
|
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/24 11:18:04 by adjoly #+# #+# */
|
/* Created: 2024/04/24 11:18:04 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/18 13:30:40 by adjoly ### ########.fr */
|
/* Updated: 2024/07/18 16:58:27 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ int main(int ac, char **av, char **env)
|
|||||||
if (!env_l)
|
if (!env_l)
|
||||||
return (EXIT_FAILURE);
|
return (EXIT_FAILURE);
|
||||||
get_env(&env_l);
|
get_env(&env_l);
|
||||||
get_exit_code(727);
|
get_exit_code(0);
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
rl = __rl(env_l);
|
rl = __rl(env_l);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/06/30 12:52:22 by adjoly #+# #+# */
|
/* Created: 2024/06/30 12:52:22 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/16 14:24:14 by adjoly ### ########.fr */
|
/* Updated: 2024/07/18 17:04:06 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -42,13 +42,3 @@ bool check_pipe(char *readline)
|
|||||||
}
|
}
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool check_space(char *rl)
|
|
||||||
{
|
|
||||||
while (*rl && *rl == ' ')
|
|
||||||
rl++;
|
|
||||||
if (!*rl)
|
|
||||||
return (send_error_parsing(ERROR_NO_FILE));
|
|
||||||
else
|
|
||||||
return (false);
|
|
||||||
}
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/07/18 13:30:27 by adjoly #+# #+# */
|
/* Created: 2024/07/18 13:30:27 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/18 14:01:24 by mmoussou ### ########.fr */
|
/* Updated: 2024/07/18 17:03:08 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -19,8 +19,8 @@ bool run_checks(char *rl)
|
|||||||
{
|
{
|
||||||
if (!*rl)
|
if (!*rl)
|
||||||
return (true);
|
return (true);
|
||||||
if (check_space(rl))
|
// if (check_space(rl))
|
||||||
return (true);
|
//return (true);
|
||||||
add_history(rl);
|
add_history(rl);
|
||||||
if (check_syntax(rl))
|
if (check_syntax(rl))
|
||||||
return (true);
|
return (true);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/05/20 21:05:04 by adjoly #+# #+# */
|
/* Created: 2024/05/20 21:05:04 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/18 14:08:29 by adjoly ### ########.fr */
|
/* Updated: 2024/07/18 17:00:51 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/05/02 14:42:00 by adjoly #+# #+# */
|
/* Created: 2024/05/02 14:42:00 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/09 14:36:05 by adjoly ### ########.fr */
|
/* Updated: 2024/07/18 16:57:47 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -14,18 +14,10 @@
|
|||||||
#include "libft.h"
|
#include "libft.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
|
|
||||||
char *get_pwd(t_env *env)
|
char *_format_pwd(char *pwd, char *home)
|
||||||
{
|
{
|
||||||
char *pwd;
|
|
||||||
char *home;
|
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
pwd = env_get_value("PWD", env);
|
|
||||||
if (!pwd)
|
|
||||||
return (NULL);
|
|
||||||
home = env_get_value("HOME", env);
|
|
||||||
if (!home)
|
|
||||||
return (NULL);
|
|
||||||
if (!ft_strncmp(pwd, home, ft_strlen(home) - 1))
|
if (!ft_strncmp(pwd, home, ft_strlen(home) - 1))
|
||||||
{
|
{
|
||||||
tmp = pwd;
|
tmp = pwd;
|
||||||
@ -40,3 +32,20 @@ char *get_pwd(t_env *env)
|
|||||||
free(home);
|
free(home);
|
||||||
return (pwd);
|
return (pwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *get_pwd(t_env *env)
|
||||||
|
{
|
||||||
|
char *pwd;
|
||||||
|
char *home;
|
||||||
|
|
||||||
|
pwd = env_get_value("PWD", env);
|
||||||
|
if (!pwd)
|
||||||
|
return (NULL);
|
||||||
|
home = env_get_value("HOME", env);
|
||||||
|
if (!home)
|
||||||
|
{
|
||||||
|
free(pwd);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
return (_format_pwd(pwd, home));
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user