Browse Source

fix some bug

dev/ina
ina 9 months ago
parent
commit
20d9f117fb
7 changed files with 15 additions and 15 deletions
  1. +3
    -2
      includes/minishell.h
  2. +2
    -2
      srcs/execute_line.c
  3. +1
    -1
      srcs/execute_utils.c
  4. +3
    -2
      srcs/main.c
  5. +2
    -4
      srcs/refine_command/redirection_error.c
  6. +2
    -2
      srcs/run_many_cmd.c
  7. +2
    -2
      srcs/run_one_cmd.c

+ 3
- 2
includes/minishell.h View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: chlee <chlee@student.42.fr> +#+ +:+ +#+ */
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/07 17:33:25 by ina #+# #+# */
/* Updated: 2021/01/30 04:02:38 by chlee ### ########.fr */
/* Updated: 2021/01/30 22:57:36 by ina ### ########.fr */
/* */
/* ************************************************************************** */

@@ -24,6 +24,7 @@
# include <sys/types.h>
# include <sys/stat.h>
# include <signal.h>
# include <stdio.h>

# define SHELL_NAME "minishell"
# define MODE_DEFAULT 0


+ 2
- 2
srcs/execute_line.c View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* execute_line.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: chlee <chlee@student.42.fr> +#+ +:+ +#+ */
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/21 01:24:34 by ina #+# #+# */
/* Updated: 2021/01/30 14:32:35 by chlee ### ########.fr */
/* Updated: 2021/02/19 18:31:36 by ina ### ########.fr */
/* */
/* ************************************************************************** */



+ 1
- 1
srcs/execute_utils.c View File

@@ -6,7 +6,7 @@
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/26 22:23:47 by ina #+# #+# */
/* Updated: 2021/01/30 12:30:00 by ina ### ########.fr */
/* Updated: 2021/02/19 18:31:44 by ina ### ########.fr */
/* */
/* ************************************************************************** */



+ 3
- 2
srcs/main.c View File

@@ -3,14 +3,15 @@
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: chlee <chlee@student.42.fr> +#+ +:+ +#+ */
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/07 17:01:45 by ina #+# #+# */
/* Updated: 2021/01/30 05:29:59 by chlee ### ########.fr */
/* Updated: 2021/02/19 18:31:55 by ina ### ########.fr */
/* */
/* ************************************************************************** */

#include "minishell.h"
#include <stdio.h>

void print_banner(void)
{


+ 2
- 4
srcs/refine_command/redirection_error.c View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* redirection_error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: chlee <chlee@student.42.fr> +#+ +:+ +#+ */
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/25 18:57:37 by chlee #+# #+# */
/* Updated: 2021/01/25 19:28:54 by chlee ### ########.fr */
/* Updated: 2021/02/19 18:32:13 by ina ### ########.fr */
/* */
/* ************************************************************************** */

@@ -18,7 +18,6 @@ void print_redirection_ambiguous_error(char *path)
ft_putstr_fd(": ", STDERR_FILENO);
ft_putstr_fd(path, STDERR_FILENO);
ft_putendl_fd(": ambiguous redirect", STDERR_FILENO);
exit(1);
}

void print_redirection_default_error(char *path)
@@ -28,5 +27,4 @@ void print_redirection_default_error(char *path)
ft_putstr_fd(path, STDERR_FILENO);
ft_putstr_fd(": ", STDERR_FILENO);
ft_putendl_fd(strerror(errno), STDERR_FILENO);
exit(1);
}

+ 2
- 2
srcs/run_many_cmd.c View File

@@ -6,7 +6,7 @@
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/26 20:06:19 by ina #+# #+# */
/* Updated: 2021/01/29 18:14:35 by ina ### ########.fr */
/* Updated: 2021/02/19 18:30:58 by ina ### ########.fr */
/* */
/* ************************************************************************** */

@@ -20,7 +20,7 @@ void set_cmd_io(t_cmd *cmd, int in, int out, t_bool is_last)
{
dup2(cmd->io[INPUT_STREAM], in);
close(cmd->io[INPUT_STREAM]);
cmd->io[OUTPUT_STREAM] = in;
cmd->io[INPUT_STREAM] = in;
}
if (cmd->io[OUTPUT_STREAM] == STDOUT_FILENO)
{


+ 2
- 2
srcs/run_one_cmd.c View File

@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* run_one_cmd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: chlee <chlee@student.42.fr> +#+ +:+ +#+ */
/* By: ina <ina@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/24 17:27:24 by ina #+# #+# */
/* Updated: 2021/01/30 04:31:07 by chlee ### ########.fr */
/* Updated: 2021/02/19 18:32:02 by ina ### ########.fr */
/* */
/* ************************************************************************** */



Loading…
Cancel
Save