Skip to content

Commit

Permalink
VERSION 1.0.1; Contains all the basic extra needed + parsing + execut…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
frouioui committed May 27, 2018
1 parent e7afe50 commit 6155680
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 13 deletions.
Binary file added bonus/doc/42sh
Binary file not shown.
Binary file added bonus/doc/PSU_42sh_2017.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/scripting/error_syntax_script.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void print_error(char *var)
}

void print_error_var(char *var_one, char *var_two, int value_one,
int value_two)
int value_two)
{
if (value_one == -1)
print_error(var_one);
Expand Down
4 changes: 2 additions & 2 deletions src/scripting/run_script.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "script.h"

char *is_conditional_line(shell_t *shell, cond_t *cond_line, char *line,
FILE *fd)
FILE *fd)
{
int status = 0;

Expand All @@ -32,7 +32,7 @@ FILE *fd)
}

static char *check_end_condition(shell_t *shell, cond_t *cond_line, char *line,
FILE *fd)
FILE *fd)
{
if (!line)
return (NULL);
Expand Down
2 changes: 0 additions & 2 deletions src/shell_loop/execution/builtins/history_built.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "execution.h"
#include "mylib.h"

/* integration of the shell struct for future use (variable size_history) */
static void display_full_history(shell_t *shell, int fd)
{
char **history = get_whole_history(shell->paths);
Expand All @@ -27,7 +26,6 @@ static void display_full_history(shell_t *shell, int fd)
free_array_string(history);
}

/* integration of the shell struct for future use (variable size_history) */
static void display_line_history(shell_t *shell, int fd, int line_display)
{
char **history = get_whole_history(shell->paths);
Expand Down
2 changes: 1 addition & 1 deletion src/shell_loop/execution/builtins/process/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void do_it_to_child(int signum, siginfo_t *info, void *env)
}

bool init_connection(struct sigaction *save_one, struct sigaction *save_two,
void (*do_it_to_child)(int, siginfo_t *, void *))
void (*do_it_to_child)(int, siginfo_t *, void *))
{
if (sigaction(SIGINT, NULL, save_one) == SYS_CALL_ERR)
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/shell_loop/execution/builtins/process/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ unsigned int shearch_better_id(running_process_t *node)
}

bool get_process(struct sigaction *saves[2], pid_t pid, shell_t *shell,
pipe_t pipe)
pipe_t pipe)
{
unsigned int id = shearch_better_id(shell->process);

Expand All @@ -35,7 +35,7 @@ pipe_t pipe)
}

bool add_running_process(running_process_t **node, pid_t pid_process,
unsigned int id, char *name)
unsigned int id, char *name)
{
if (!node)
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/shell_loop/execution/exec_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ void exec_pipe(shell_t *shell, instruction_t *instruction, int **fd, pid_t pid)
int stat = 0;

if (UNSET_PIPE)
if (pipe(fd[instruction->actual_pipe]) == SYS_CALL_ERR)
exit(84);
if (pipe(fd[instruction->actual_pipe]) == SYS_CALL_ERR)
exit(84);
if ((pid2 = fork()) == -1)
exit(84);
if (pid2 != 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/shell_loop/parsing/glob_linked_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <string.h>

args_list_t *add_new_path(args_list_t *old_args, args_list_t *new_args,
args_list_t **tmp)
args_list_t **tmp)
{
args_list_t *old_tmp = old_args;
args_list_t *new_tmp = new_args;
Expand Down
2 changes: 0 additions & 2 deletions src/shell_loop/transformation/history/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "mylib.h"
#include "instruction.h"

/* Gets the size of the whole history and returns it. */
unsigned int size_history(char **paths)
{
unsigned int size = 0;
Expand All @@ -32,7 +31,6 @@ unsigned int size_history(char **paths)
return (size);
}

/* Returns the whole history file in a (char **) */
char **get_whole_history(char **paths)
{
char **history = malloc(sizeof(char *) * (size_history(paths) + 1));
Expand Down

0 comments on commit 6155680

Please sign in to comment.