Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions build-in/exit/ft_exit_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: yuocak <yuocak@student.42kocaeli.com.tr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/03 14:30:31 by yuocak #+# #+# */
/* Updated: 2025/08/05 12:37:09 by yuocak ### ########.fr */
/* Updated: 2025/08/05 14:24:51 by yuocak ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -40,8 +40,7 @@ int is_numeric(char *str)

i = 0;
sign = 1;
while (str[i] && (str[i] == ' ' || str[i] == '\t' || str[i] == '\n' ||
str[i] == '\r' || str[i] == '\f' || str[i] == '\v'))
while (str[i] && ft_isspace(str[i]))
i++;
if (str[i] == '-' || str[i] == '+')
{
Expand Down
10 changes: 9 additions & 1 deletion execute/execute_external.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
/* By: yuocak <yuocak@student.42kocaeli.com.tr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/07 07:45:00 by yuocak #+# #+# */
/* Updated: 2025/08/04 10:36:42 by yuocak ### ########.fr */
/* Updated: 2025/08/05 15:24:48 by yuocak ### ########.fr */
/* */
/* ************************************************************************** */

#include "../minishell.h"
#include <sys/stat.h>

static void cleanup_execution(t_exec_params *params)
{
Expand All @@ -24,8 +25,15 @@ static void cleanup_execution(t_exec_params *params)

static void child_process(t_exec_params *params)
{
struct stat st;

setup_child_signals();
execve(params->command_path, params->argv, params->envp);
if (stat(params->command_path, &st) == 0 && S_ISDIR(st.st_mode))
{
printf("minishell: %s: Is a directory\n", params->command_path);
exit(126);
}
perror("minishell");
exit(126);
}
Expand Down
6 changes: 3 additions & 3 deletions execute/execute_multiple_utils2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
/* By: yuocak <yuocak@student.42kocaeli.com.tr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/24 13:00:00 by yuocak #+# #+# */
/* Updated: 2025/08/05 13:23:17 by yuocak ### ########.fr */
/* Updated: 2025/08/05 14:20:34 by yuocak ### ########.fr */
/* */
/* ************************************************************************** */

#include "../minishell.h"

static void assign_new_command(t_token **current, t_token **commands, int *cmd_index)
static void assign_new_command(t_token **current, t_token **commands,
int *cmd_index)
{
t_token *temp;

Expand All @@ -23,7 +24,6 @@ static void assign_new_command(t_token **current, t_token **commands, int *cmd_i
*current = temp;
}


t_token **split_commands(t_token *token, int cmd_count)
{
t_token **commands;
Expand Down