norm ok + compile
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/06 20:46:19 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/27 17:18:03 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/03/27 17:24:55 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -36,7 +36,7 @@ t_token *cmd_add_back(t_token *cmd, char *value, t_token_type type)
|
||||
return (cmd);
|
||||
}
|
||||
|
||||
int free_cmd(t_token *cmd)
|
||||
t_token *free_cmd(t_token *cmd)
|
||||
{
|
||||
if (cmd)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/02 21:59:20 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/27 17:02:16 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/03/27 17:33:15 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -75,7 +75,9 @@ int init_minishell(t_msh **msh, int argc, char **argv, char **envp)
|
||||
{
|
||||
struct termios t_p;
|
||||
|
||||
ft_exit(*msh, 1);
|
||||
*msh = ft_calloc(1, sizeof(t_msh));
|
||||
if (!*msh)
|
||||
ft_exit(*msh, 1);
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
(*msh)->env = get_env(envp);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/27 17:20:14 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/03/27 17:25:41 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -66,7 +66,7 @@ typedef struct s_msh
|
||||
extern int g_return_code;
|
||||
|
||||
t_token *cmd_add_back(t_token *res, char *token, t_token_type type);
|
||||
int free_cmd(t_token *cmd);
|
||||
t_token *free_cmd(t_token *cmd);
|
||||
void exec_commands(t_msh *msh);
|
||||
int echo(t_token *args);
|
||||
int exit_bt(t_msh *msh);
|
||||
@ -119,6 +119,7 @@ int contains_newline(char *str);
|
||||
void parse_var(t_msh *msh, char *line);
|
||||
int set_echoctl(int value);
|
||||
int add_return_code_to_str(char *res);
|
||||
int parsing_syntax_error(t_token *res);
|
||||
t_token *parsing_syntax_error(t_token *res);
|
||||
int check_var_name(char *name);
|
||||
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/09 15:24:36 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/27 17:09:50 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/03/27 17:23:21 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -100,8 +100,8 @@ int add_var_to_str(char *res, char **command, t_env *env)
|
||||
var_name = get_var_name(*command);
|
||||
var = ft_get_env(env, var_name);
|
||||
free(var_name);
|
||||
while (var && var[i])
|
||||
res[i] = var[i++];
|
||||
while (var && var[i++])
|
||||
res[i - 1] = var[i - 1];
|
||||
*command += get_var_name_len(*command) - 1;
|
||||
return (i);
|
||||
}
|
||||
|
@ -6,13 +6,13 @@
|
||||
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/27 17:19:27 by tomoron #+# #+# */
|
||||
/* Updated: 2024/03/27 17:19:35 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/03/27 17:25:54 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
int parsing_syntax_error(t_token *res)
|
||||
t_token *parsing_syntax_error(t_token *res)
|
||||
{
|
||||
free_cmd(res);
|
||||
ft_putstr_fd("minishell: syntax error\n", 2);
|
||||
|
Reference in New Issue
Block a user