diff --git a/README.md b/README.md deleted file mode 100644 index fd0a233..0000000 --- a/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Minishell - -Minishell is a 42 School project that involves creating a minimalistic shell in C language. The shell should be able to handle basic commands, manage environment variables and implement several built-in functions. - -## Features - -- Prompt management (display, editing, history) -- Command execution (with or without arguments) -- Basic shell operations (pipes, redirections) -- Environment variables management (listing, setting, unsetting) -- Built-in functions management (echo, cd, env, exit, export, pwd, unset) - -## Getting started - -1. Clone this repository: `git clone https://github.com//minishell.git` -2. `cd` into the cloned directory: `cd minishell` -3. Run the `make` command to compile the program: `make` -4. Start the shell by running the executable: `./minishell` - -## Usage - -Once the shell is started, you can enter commands as you would with any other shell. The following are some examples of commands that can be executed: - -- Display the working directory: `pwd` -- Change directory: `cd ` -- Print the value of an environment variable: `echo $` -- Set an environment variable: `export =` -- Unset an environment variable: `unset ` -- Display a list of environment variables: `env` -- Exit the shell: `exit` - -## Resources - -- ![The project subject](./subject.pdf) -- The C library documentation for the standard library functions used in the program -- bash man - -## Authors - -This project was created by [Camille CHAUVET](mailto:camille@chauvet.pro) and [Xamora](mailto:ogame.xamora@42l.fr). If you have any questions or suggestions, feel free to contact us. \ No newline at end of file diff --git a/builtins/builtins_private.h b/builtins/builtins_private.h index 693078d..0d39bf3 100644 --- a/builtins/builtins_private.h +++ b/builtins/builtins_private.h @@ -6,7 +6,7 @@ /* By: cchauvet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/22 13:28:27 by erey-bet #+# #+# */ -/* Updated: 2023/03/30 15:07:10 by erey-bet ### ########.fr */ +/* Updated: 2023/04/07 12:46:28 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,7 +16,7 @@ int error(char *str, int fd) { write(fd, "bozoshell: unset: `", 19); write(fd, str, ft_strlen(str)); - write(fd, "': not a valid identifier", 25); + write(fd, "': not a valid identifier\n", 26); return (1); } diff --git a/env/env3.c b/env/env3.c index 5c058ab..38462f2 100644 --- a/env/env3.c +++ b/env/env3.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/17 17:25:09 by erey-bet #+# #+# */ -/* Updated: 2023/03/30 12:51:54 by erey-bet ### ########.fr */ +/* Updated: 2023/04/07 13:21:54 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -70,6 +70,7 @@ int delete_by_key(char *key, t_list **head) t_list *current; current = *head; + last = NULL; while (current->next != NULL) { if (ft_strcmp(((t_env *)current->content)->key, key) == 0) @@ -77,7 +78,7 @@ int delete_by_key(char *key, t_list **head) free(((t_env *)current->content)->key); free(((t_env *)current->content)->value); free(current->content); - if (last->next != NULL) + if (last && last->next) last->next = current->next; else *head = current->next; diff --git a/subject.pdf b/subject.pdf deleted file mode 100644 index e3ed01f..0000000 Binary files a/subject.pdf and /dev/null differ diff --git a/vsupp b/vsupp deleted file mode 100644 index 1b3bbf6..0000000 --- a/vsupp +++ /dev/null @@ -1,15 +0,0 @@ -{ - readline - Memcheck:Leak - ... - fun:readline - ... -} - -{ - readline - Memcheck:Leak - ... - fun:add_history - ... -}