42/minishell.git
19 months agoRename almost_empty to is_almost_empty
Lukas Jiriste [Fri, 3 May 2024 06:58:45 +0000 (08:58 +0200)]
Rename almost_empty to is_almost_empty

19 months agoAdd version without history
Lukas Jiriste [Thu, 2 May 2024 12:40:05 +0000 (14:40 +0200)]
Add version without history

This version doesn't utilize GNU Readline so it has much lower memory
footprint. The main benefit however is that tracking with valgrind is
made easier with this.

19 months agoImplement variables framework, update Libft
Lukas Jiriste [Thu, 2 May 2024 11:27:09 +0000 (13:27 +0200)]
Implement variables framework, update Libft

So far the variable handling consists of copying the environment
inherited by minishell to separate variable to make changes to it
possible (I suspect that one should not directly change the environ).

The vars struct consists of 2 vectos of strings, one for the exported
variables and one for the others.
This is done so that the exported->vec can be directly passed to execve
instead of contructing it by filtering the exported values from
a common vector.
This is also why the vector is initialized with NULL. The other vec
is constructed the same way so as to be able to reuse the code for
exported.

During work on this commit the function ft_strcat_alloc seemed to be
a great candidate for  addition to Libft. That was done and the
function was used in this commit, hence the Libft update.

19 months agoImplement exitable skeleton of a shell
Lukas Jiriste [Fri, 26 Apr 2024 12:03:25 +0000 (14:03 +0200)]
Implement exitable skeleton of a shell

The minishell is now able to accept input and access history through
the GNU Readline library.
The minishell itself prints prompt with currect directory.
It also handles the "exit" command as well as ctrl-D
so that it can exit. It prints "exit" on exit like bash.

19 months agoCreate the foundations for minishell
Lukas Jiriste [Fri, 26 Apr 2024 11:15:23 +0000 (13:15 +0200)]
Create the foundations for minishell

First commit contains .gitignore, Makefile and an empty main.c.
I also added Libft as a submodule, because I'll certainly use it.