fix $ en fin de chaine

This commit is contained in:
2024-04-22 16:43:50 +02:00
parent f37b0cf8bc
commit d35e48eb4f
4 changed files with 12 additions and 12 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */ /* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */
/* Updated: 2024/04/22 15:39:40 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 16:43:18 by tomoron ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -152,11 +152,12 @@ void print_signaled(int status)
static const char *sigmsg[] = {0, "Hangup", 0, "Quit", \ static const char *sigmsg[] = {0, "Hangup", 0, "Quit", \
"Illegal instruction", "Trace/breakpoint trap", "Aborted", "Bus error", \ "Illegal instruction", "Trace/breakpoint trap", "Aborted", "Bus error", \
"Floating point exception", "Killed", "User defined signal 1", \ "Floating point exception", "Killed", "User defined signal 1", \
"Segmentation fault", "User defined signal 2", 0, "Alarm clock", \ "Segmentation fault (skill issue)", "User defined signal 2", 0,\
"Terminated", "Stack fault" ,0 ,0, "Stopped", "Stopped","Stopped", \ "Alarm clock", "Terminated", "Stack fault" ,0 ,0, "Stopped", "Stopped",\
"Stopped", 0, "CPU time limit exceeded","File size limit exceeded", \ "Stopped", "Stopped", 0, "CPU time limit exceeded",\
"Virtual time expired", "Profiling timer expired", \ "File size limit exceeded", "Virtual time expired",\
"I/O possible", "Power failure", "Bad system call"}; "Profiling timer expired","I/O possible", "Power failure",\
"Bad system call"};
signal = WTERMSIG(status); signal = WTERMSIG(status);
if(signal < 31 && sigmsg[signal]) if(signal < 31 && sigmsg[signal])

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */
/* Updated: 2024/04/22 16:36:10 by tomoron ### ########.fr */ /* Updated: 2024/04/22 16:42:49 by tomoron ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -65,7 +65,6 @@ int get_in_type(t_msh *msh, t_cmd *tokens)
cur_token = tokens; cur_token = tokens;
if (cur_token && cur_token->cmd_type == PIPE) if (cur_token && cur_token->cmd_type == PIPE)
{
msh->in_type = PIPE; msh->in_type = PIPE;
cur_token = cur_token->next; cur_token = cur_token->next;
} }

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 15:24:36 by tomoron #+# #+# */ /* Created: 2024/02/09 15:24:36 by tomoron #+# #+# */
/* Updated: 2024/04/18 20:48:58 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 14:46:18 by tomoron ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -28,7 +28,7 @@ int get_var_len(char **command, t_env *env)
char *env_var; char *env_var;
(*command)++; (*command)++;
if (**command == '\'' || **command == '"') if (**command == '\'' || **command == '"' || !**command)
return (1); return (1);
if (!ft_isalnum(**command) && **command != '_' && **command != '?') if (!ft_isalnum(**command) && **command != '_' && **command != '?')
return (2); return (2);
@ -87,7 +87,7 @@ int add_var_to_str(char *res, char **command, t_env *env)
i = 0; i = 0;
(*command)++; (*command)++;
if (**command == '\'' || **command == '"') if (**command == '\'' || **command == '"' || !**command)
{ {
*res = '$'; *res = '$';
(*command)--; (*command)--;

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:19:26 by marde-vr #+# #+# */ /* Created: 2024/03/05 18:19:26 by marde-vr #+# #+# */
/* Updated: 2024/04/22 14:33:56 by marde-vr ### ########.fr */ /* Updated: 2024/04/22 16:43:31 by tomoron ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */