42/minishell.git
15 months agoAbsorb Libft into minishell for 42 evaluation 42
Lukas Jiriste [Sun, 1 Sep 2024 13:25:48 +0000 (15:25 +0200)]
Absorb Libft into minishell for 42 evaluation

15 months agoMake the project entirely compliant with the Norm
Lukas Jiriste [Sun, 1 Sep 2024 12:40:18 +0000 (14:40 +0200)]
Make the project entirely compliant with the Norm

15 months agoInitialize status in subshell
Lukas Jiriste [Sun, 1 Sep 2024 12:13:48 +0000 (14:13 +0200)]
Initialize status in subshell

Status is initialized to silence valgrind complaining about conditional
being dependent on uninitialized value.

15 months agoMade wildcard expansion more responsive to signals
Lukas Jiriste [Sun, 1 Sep 2024 09:24:02 +0000 (11:24 +0200)]
Made wildcard expansion more responsive to signals

15 months agoRefactor execution.c to files of max 5 functions
Lilia-42 [Sun, 1 Sep 2024 12:07:07 +0000 (14:07 +0200)]
Refactor execution.c to files of max 5 functions

15 months agoMake shell wait for processes to end after signal
Lukas Jiriste [Sun, 1 Sep 2024 08:20:58 +0000 (10:20 +0200)]
Make shell wait for processes to end after signal

Before the shell would send the signal to children and assume they
terminated. Now it actually still waits for them to terminate.

15 months agoRefactor termios
Lukas Jiriste [Sun, 1 Sep 2024 07:48:47 +0000 (09:48 +0200)]
Refactor termios

15 months agoFree the env->fds_to_close on exit
Lukas Jiriste [Sun, 1 Sep 2024 07:34:32 +0000 (09:34 +0200)]
Free the env->fds_to_close on exit

15 months agoFix tokenization type comparison
Lukas Jiriste [Sun, 1 Sep 2024 07:22:34 +0000 (09:22 +0200)]
Fix tokenization type comparison

The tokenization was built around the types not being allocated to lower
the number of failure points. This was achieved by creating a static
constant global array that holds all the possible values. The type
character pointer in every token then points to a value in this array.

This was exploited to make string comparison faster - instead of
comparing every character, only the address (the raw pointer) was
compared.

This was broken by moving the definition of the static global variable
into a header file. With that every file that includes it gets its own
version of the variable - its own memory - and te comparison fails.

The solution is the make an access function that holds the definition
of the static variable and all the other functions access the variable
through this function instead of directly. Now the variable is only ever
defined inside the function and address comparison works again.

15 months agoMake all functions comply with the 42 Norm
Lukas Jiriste [Sun, 1 Sep 2024 06:50:38 +0000 (08:50 +0200)]
Make all functions comply with the 42 Norm

15 months agoAdd *.orig to .gitignore, remove execution.c.orig
Lukas Jiriste [Sun, 1 Sep 2024 05:57:27 +0000 (07:57 +0200)]
Add *.orig to .gitignore, remove execution.c.orig

Git backs up the original files when merging saving them as *.orig.
These should not be committed as they provide little value to the the
repository.

15 months agoFix comments and noninitialized res in categorize
Lukas Jiriste [Sat, 31 Aug 2024 16:58:10 +0000 (18:58 +0200)]
Fix comments and noninitialized res in categorize

15 months agoMake most functions in execution.c Normal
Lukas Jiriste [Sat, 31 Aug 2024 16:38:12 +0000 (18:38 +0200)]
Make most functions in execution.c Normal

All but one function were rewritten to comply with the 42 Norm.
Some small obvious bugs were also fixed as to not be forgotten.

15 months agoRefactor some files to comply with the 42 Norm
Lilia-42 [Sat, 31 Aug 2024 16:19:35 +0000 (18:19 +0200)]
Refactor some files to comply with the 42 Norm

tokenization.c and wildcards.c were each split to 3 files
to comply with the "max 5 functions per file" rule of the Norm

15 months agoMake vars.c comply with the 42 Norm
Lilia-42 [Sat, 31 Aug 2024 12:47:38 +0000 (14:47 +0200)]
Make vars.c comply with the 42 Norm

It was split to vars.c and vars_helpers.c

15 months agoMake some functions comply with the 42 Norm
Lukas Jiriste [Sat, 31 Aug 2024 11:36:40 +0000 (13:36 +0200)]
Make some functions comply with the 42 Norm

Make functions inside tokenization.c and wildcards.c comply with the 42
Norm.

15 months agoSimplify tokenization
Lukas Jiriste [Sat, 31 Aug 2024 10:00:44 +0000 (12:00 +0200)]
Simplify tokenization

Because minishell should error out when unpaired quotes are encountered,
the handling is unnecessary as is the input of char** instead of char*.

15 months agoMake lines comply with the 42 Norm
Lilia-42 [Sat, 31 Aug 2024 11:34:06 +0000 (13:34 +0200)]
Make lines comply with the 42 Norm

15 months agoAdd (VSCode) *.json files to gitignore
Lilia-42 [Sat, 31 Aug 2024 09:27:29 +0000 (11:27 +0200)]
Add (VSCode) *.json files to gitignore

15 months agoMake lines in most files comply with the 42 Norm
Lilia-42 [Sat, 31 Aug 2024 09:26:21 +0000 (11:26 +0200)]
Make lines in most files comply with the 42 Norm

15 months agoImprove Makefile
Lukas Jiriste [Sat, 31 Aug 2024 09:06:49 +0000 (11:06 +0200)]
Improve Makefile

Make now tries to build Libft everytime but when libft.a stays the same
(no change made in Libft) the libft.a is considered not changed.
Before the libft.a was assumed to never be up to date (PHONY) hence the
minishell was always rebuilt.
Before that even the changes in Libft didn't trigger building of libft.a
when minishell make was run.

15 months agoRefactor input_method.c to rl and noleaks versions
Lukas Jiriste [Sat, 31 Aug 2024 08:25:48 +0000 (10:25 +0200)]
Refactor input_method.c to rl and noleaks versions

15 months agoFix readline behaviour on SIGINT
Lukas Jiriste [Sat, 31 Aug 2024 07:10:24 +0000 (09:10 +0200)]
Fix readline behaviour on SIGINT

Special signal handler is provided that uses readling functions.
I could not find info on whether the functions used in this handler are
reentrant but hopefully this will work.

15 months agoMake shell wait for all child processes to end
Lukas Jiriste [Fri, 30 Aug 2024 15:41:27 +0000 (17:41 +0200)]
Make shell wait for all child processes to end

15 months agoMake the forks close ALL fds except the needed ones
Lukas Jiriste [Fri, 30 Aug 2024 15:36:49 +0000 (17:36 +0200)]
Make the forks close ALL fds except the needed ones

The recorsive (non-forking) ex_pipeline creates pipes that are inherited
by forked processes. These processes only need the latest opened pipe so
for the healt of other commands the other pipes should be closed.

15 months agoSet return value to 1 when input file is not found
Lukas Jiriste [Fri, 30 Aug 2024 12:52:09 +0000 (14:52 +0200)]
Set return value to 1 when input file is not found

Input file for redirection.

15 months agoSet return value to 127 when command is not found
Lukas Jiriste [Fri, 30 Aug 2024 12:43:27 +0000 (14:43 +0200)]
Set return value to 127 when command is not found

15 months agoFix variable expansion inside quoted single quotes
Lukas Jiriste [Fri, 30 Aug 2024 12:23:10 +0000 (14:23 +0200)]
Fix variable expansion inside quoted single quotes

15 months agoFix export var validation
Lukas Jiriste [Fri, 30 Aug 2024 07:20:56 +0000 (09:20 +0200)]
Fix export var validation

Assignment word recognition was changed so that export can
reuse part of its logic.

15 months agoMerge builtin piping fix into trunk
Lukas Jiriste [Thu, 29 Aug 2024 16:24:30 +0000 (18:24 +0200)]
Merge builtin piping fix into trunk

15 months agoImplement signal handling for execution
Lukas Jiriste [Thu, 29 Aug 2024 16:22:30 +0000 (18:22 +0200)]
Implement signal handling for execution

It may need some additional output.

15 months agoImplement signal handling on wildcard expansion
Lukas Jiriste [Thu, 29 Aug 2024 15:22:14 +0000 (17:22 +0200)]
Implement signal handling on wildcard expansion

15 months agoAdd some signal handling for prompt
Lukas Jiriste [Thu, 29 Aug 2024 14:19:07 +0000 (16:19 +0200)]
Add some signal handling for prompt

Signal handling for prompt is mostly done. Only generating a new prompt
when readline gets SIGINT and not erasing ^\ on ctrl-\ on NOLEAKS is
unresolved.
The expected behavior is to output a newline and a new prompt, readline
instead moves the cursor to the start of the current line while
preserving the prompt (so input rewrites the prompt).

15 months agoFix piping of built-in functions
Lilia-42 [Thu, 29 Aug 2024 09:22:25 +0000 (11:22 +0200)]
Fix piping of built-in functions

For piping/redirections of built-in functions the STD_FILENOs
are supposed to be dupped and saved. But the STDIN was dupped
3 times instead of each of STDIN, STDOUT, STDERR being dupped once.

15 months agoChange Makefile to permit usage of sigaction
Lukas Jiriste [Thu, 29 Aug 2024 08:06:53 +0000 (10:06 +0200)]
Change Makefile to permit usage of sigaction

The C99 standard does not include the sigaction function and structure
as they are (probably) GNU extensions. Using the GNU99 version instead
permits the extension usage.

15 months agoMake variable assignment possible in subshell
Lukáš Jiřiště [Wed, 28 Aug 2024 08:34:29 +0000 (10:34 +0200)]
Make variable assignment possible in subshell

Because of ASSIGNMENT_WORD filtering, subshell needs a special rule (the
same as AND_IF, OR_IF) to permit variable assignment to be recognized
imediatelly after subshell starts.

15 months agoMake subshell execute in a new process
Lukáš Jiřiště [Wed, 28 Aug 2024 07:59:34 +0000 (09:59 +0200)]
Make subshell execute in a new process

Because the OS keeps track of CWDs of its processes, subshell is made to
run in its own process not to change the CWD of main shell.
Also make exit the last executed command in a pipeline and in a program.

15 months agoRemove may_exit member of env
Lukáš Jiřiště [Tue, 27 Aug 2024 15:02:44 +0000 (17:02 +0200)]
Remove may_exit member of env

This was implemented to mimic the behaviour of piped exit.
But bash just runs piped commands in separate processes which leads to
piped builtins not having effect on the current session.
So I think it will be more pure without this check and if the bash
behaviour is needed, piping may be delegated to forked processes.

15 months agoExpand filenames in redirections
Lukáš Jiřiště [Tue, 27 Aug 2024 14:42:42 +0000 (16:42 +0200)]
Expand filenames in redirections

15 months agoMake env initialize properly
Lukáš Jiřiště [Tue, 27 Aug 2024 14:40:30 +0000 (16:40 +0200)]
Make env initialize properly

The last_was_builtin may be checked in ex_pipeline without
initialization because variable assignment does not run ex_fields
(which sets last_was_builtin).

15 months agoFix variable assignment broken by 7d83204
Lukáš Jiřiště [Tue, 27 Aug 2024 13:31:10 +0000 (15:31 +0200)]
Fix variable assignment broken by 7d83204

Also free assignments with free_str isntead of free.

15 months agoAdd exit codes, make exit a "normal" built-in
Lukáš Jiřiště [Tue, 27 Aug 2024 13:09:13 +0000 (15:09 +0200)]
Add exit codes, make exit a "normal" built-in

15 months agoRefactor input methods
Lukáš Jiřiště [Tue, 27 Aug 2024 12:33:12 +0000 (14:33 +0200)]
Refactor input methods

Input functions are moved and renamed so that laternatives have the same
name. This makes it easier to change main as there is a single version.

15 months agoFix export return value and error output
Lukáš Jiřiště [Tue, 27 Aug 2024 11:21:21 +0000 (13:21 +0200)]
Fix export return value and error output

15 months agoFix pipeline behaviour
Lukáš Jiřiště [Tue, 27 Aug 2024 09:37:57 +0000 (11:37 +0200)]
Fix pipeline behaviour

The return value is now set only after pipeline finishes (to the return
value of last command).
The shell also does not wait for each commmand in pipeline to end before
starting the following command (preventing getting stuck on full pipe).
Built-in functions still can get stuck when pipe gets full.

15 months agoFix setting another value to exported variable
Lukáš Jiřiště [Tue, 27 Aug 2024 08:07:46 +0000 (10:07 +0200)]
Fix setting another value to exported variable

Instead of setting an exported variable to new value with the command of
the form <NAME>=<NEW_VALUE> a new non-exported variable was created and
used for variable expasion. The exported value was passed to child
processes.
This behaviour is fixed by this commit to the expected setting of
exported variable to the new value.

15 months agoImplement pipes and redirection for builtins
Lukáš Jiřiště [Mon, 26 Aug 2024 14:48:02 +0000 (16:48 +0200)]
Implement pipes and redirection for builtins

The feature is implemented except for error handling. Especially the
restoring of STD*_FILENO should be handled and exit the minishell hwne
they cannot be reopened.

15 months agoFix tokenization double free
Lukáš Jiřiště [Mon, 26 Aug 2024 14:16:51 +0000 (16:16 +0200)]
Fix tokenization double free

When an unclosed quotes are detected, tokenization fails. This causes
double free because the current_token is appended to tokens (because
current_token.size > 0) and is freed 4 lines below. The double free
happens when the tokens vector frees its memory.

15 months agoFix tokenization bug introduced in aac1d76
Lukáš Jiřiště [Mon, 26 Aug 2024 10:08:16 +0000 (12:08 +0200)]
Fix tokenization bug introduced in aac1d76

In commit aac1d76 the tokenization was changed to set ASSIGNMENT_WORDs
to WORDs when the ASSIGNMENT_WORD is not in a proper place.
The filter however didn't check whether current token is ASSIGNMENT_WORD
hence other tokens could be changed to WORD also.

15 months agoImplement built-in function unset
Lukáš Jiřiště [Mon, 26 Aug 2024 09:53:30 +0000 (11:53 +0200)]
Implement built-in function unset

15 months agoCreate header file for builtins
Lukáš Jiřiště [Mon, 26 Aug 2024 09:46:19 +0000 (11:46 +0200)]
Create header file for builtins

15 months agoMove struct managing declarations to new file
Lukáš Jiřiště [Mon, 26 Aug 2024 07:44:55 +0000 (09:44 +0200)]
Move struct managing declarations to new file

Also move var managing functions from execution.c to vars.c.

15 months agoImplement the export function, change tokenization
Lukas Jiriste [Fri, 23 Aug 2024 16:46:21 +0000 (18:46 +0200)]
Implement the export function, change tokenization

The tokenization had to be changed because "export te=te" was refused by
the parser. The "te=te" part was tokenized as ASSIGNMENT_WORD which can
only occur before command. So any ASSIGNMENT_WORD after command name is
now recognized as WORD.

15 months agoFix return codes of cd, add error message to cd
Lukas Jiriste [Fri, 23 Aug 2024 14:41:51 +0000 (16:41 +0200)]
Fix return codes of cd, add error message to cd

15 months agoFix showing single quotes upon expansion
Lukas Jiriste [Fri, 23 Aug 2024 14:19:22 +0000 (16:19 +0200)]
Fix showing single quotes upon expansion

In order for the wildcard expanded words not to be expanded again as
variables, single quotes were used for variable expansion. This however
caused single quotes to show when variable was expanded inside double
quotes.
The solution is to only quote the variables in wildcard expansion.

15 months agoModified: function pwd updated to return current path with or without arguments
Lilia-42 [Fri, 23 Aug 2024 14:09:37 +0000 (16:09 +0200)]
Modified: function pwd updated to return current path with or without arguments

15 months agoImplement $? handling
Lukas Jiriste [Fri, 23 Aug 2024 13:42:36 +0000 (15:42 +0200)]
Implement $? handling

15 months agoMake minishell not expand non-names
Lukas Jiriste [Fri, 23 Aug 2024 11:41:25 +0000 (13:41 +0200)]
Make minishell not expand non-names

15 months agoFix echo crashing upon accepting no input
Lukas Jiriste [Thu, 22 Aug 2024 15:54:02 +0000 (17:54 +0200)]
Fix echo crashing upon accepting no input

15 months agoFix the return value of the builtins
Lukas Jiriste [Thu, 22 Aug 2024 15:54:02 +0000 (17:54 +0200)]
Fix the return value of the builtins

15 months agoMerge branch builtins into wildcards
Lukas Jiriste [Thu, 22 Aug 2024 15:30:44 +0000 (17:30 +0200)]
Merge branch builtins into wildcards

15 months agoAdd env & pwd
Lilia-42 [Thu, 22 Aug 2024 15:07:07 +0000 (17:07 +0200)]
Add env & pwd

15 months agoFix issues with patterns of form /*/
Lukas Jiriste [Thu, 22 Aug 2024 15:05:41 +0000 (17:05 +0200)]
Fix issues with patterns of form /*/

When introducing the handling of multiple slashed one after another
(eg. "///*") the handling of "/*/" patterns stopped working because the
asterisk could be assumed to be 0 symbols resulting in // which was
simplified to / effectively skipping a layer of dirs.

15 months agoFix shenanigans of wildcards with quotes
Lukas Jiriste [Thu, 22 Aug 2024 13:24:28 +0000 (15:24 +0200)]
Fix shenanigans of wildcards with quotes

For example "echo *''" or "echo *'*'" didn't work.

15 months agoMake wildcards work with variables and quotes
Lukas Jiriste [Thu, 22 Aug 2024 12:40:00 +0000 (14:40 +0200)]
Make wildcards work with variables and quotes

15 months agoMake wildcard expansion quoted
Lukas Jiriste [Thu, 22 Aug 2024 11:05:21 +0000 (13:05 +0200)]
Make wildcard expansion quoted

This is done for the expansion not to be expanded further for variable
names. This also prevents files with spae in their name to be split to
multiple tokens.

15 months agoImprove wildcard recognition
Lukas Jiriste [Thu, 22 Aug 2024 11:04:08 +0000 (13:04 +0200)]
Improve wildcard recognition

15 months agoAdd echo builtin function
Lilia-42 [Thu, 22 Aug 2024 11:40:10 +0000 (13:40 +0200)]
Add echo builtin function

15 months agoFix the wildcards' interaction with directories
Lukas Jiriste [Thu, 22 Aug 2024 09:53:24 +0000 (11:53 +0200)]
Fix the wildcards' interaction with directories

15 months agoAdd '*' and '?' wildcard support
Lukas Jiriste [Thu, 8 Aug 2024 13:40:35 +0000 (15:40 +0200)]
Add '*' and '?' wildcard support

15 months agoMake tokenization function smaller, fix quotes
Lukas Jiriste [Thu, 8 Aug 2024 08:40:40 +0000 (10:40 +0200)]
Make tokenization function smaller, fix quotes

Reduce the tokenization function line count by combining some lines
and introducing a new function.
Add warning for non-ended quotes.

16 months agoMake the parsing table structure static
Lukas Jiriste [Fri, 2 Aug 2024 16:51:44 +0000 (18:51 +0200)]
Make the parsing table structure static

This makes it a little more memory and CPU friendly, because the table
doesn't need to be reallocated and parsed from the text form every
command. The downside itt needs to be cleared at the end of the program.

16 months agoImplement the change directory (cd) builtin
Lukas Jiriste [Fri, 2 Aug 2024 16:43:10 +0000 (18:43 +0200)]
Implement the change directory (cd) builtin

It supports the $PWD variable and ~/nothign for home dir.

16 months agoMake empty input not emit error (or anything else)
Lukas Jiriste [Fri, 2 Aug 2024 15:06:46 +0000 (17:06 +0200)]
Make empty input not emit error (or anything else)

16 months agoFix crashes on empty input
Lukas Jiriste [Fri, 2 Aug 2024 15:03:49 +0000 (17:03 +0200)]
Fix crashes on empty input

16 months agoImprove the make system
Lukas Jiriste [Fri, 2 Aug 2024 13:50:14 +0000 (15:50 +0200)]
Improve the make system

Change the Makefile similarly to the last update of Libft.
Make now "remembers" the build settings and builds accordingly.

16 months agoUpdate Libft for better Makefile
Lukas Jiriste [Fri, 2 Aug 2024 13:13:23 +0000 (15:13 +0200)]
Update Libft for better Makefile

16 months agoRemove exe permissions from shell_parsing_table
Lukas Jiriste [Fri, 2 Aug 2024 12:35:40 +0000 (14:35 +0200)]
Remove exe permissions from shell_parsing_table

16 months agoAdd parsing table and rules to the source code
Lukas Jiriste [Fri, 2 Aug 2024 12:33:51 +0000 (14:33 +0200)]
Add parsing table and rules to the source code

This is done so that minishell does not have to load them from files
preventing minishell from not being able to find the files when being
moved around.

16 months agoUpdate Libft for the new loading of parsing table
Lukas Jiriste [Fri, 2 Aug 2024 12:29:49 +0000 (14:29 +0200)]
Update Libft for the new loading of parsing table

16 months agoMake parsing return 0 only when input is accepted
Lukas Jiriste [Thu, 1 Aug 2024 14:15:18 +0000 (16:15 +0200)]
Make parsing return 0 only when input is accepted

16 months agoRemove printing the parsing tree
Lukas Jiriste [Thu, 1 Aug 2024 14:12:00 +0000 (16:12 +0200)]
Remove printing the parsing tree

It seems to be unnecessary now.

16 months agoMake minishell close file descriptors
Lukas Jiriste [Thu, 1 Aug 2024 14:08:07 +0000 (16:08 +0200)]
Make minishell close file descriptors

File descriptors opened for redirection have to be closed also. This
commit makes minishell close the appropriate file descriptors.

16 months agoSimplify t_redirection
Lukas Jiriste [Thu, 1 Aug 2024 13:53:02 +0000 (15:53 +0200)]
Simplify t_redirection

Due to changes in f561c16753dcf7649b222c9b2e0fe6ca2445b6b9 it is
possible to get rid of created attribute of t_redirection.
It was included because of the same confusion as was talked in that
commit.

16 months agoRemove redirections from the environment
Lukas Jiriste [Thu, 1 Aug 2024 13:43:26 +0000 (15:43 +0200)]
Remove redirections from the environment

The redirections got handled in another way so this is not needed.

16 months agoMake operators < and << work
Lukas Jiriste [Thu, 1 Aug 2024 13:40:26 +0000 (15:40 +0200)]
Make operators < and << work

There was a minor confusion when the redirection was first implemented
because the usage was not yet thought about much.

16 months agoImplement redirection duping
Lukas Jiriste [Thu, 1 Aug 2024 13:28:59 +0000 (15:28 +0200)]
Implement redirection duping

16 months agoLet environment be inhereted by child processes
Lukas Jiriste [Thu, 1 Aug 2024 13:05:00 +0000 (15:05 +0200)]
Let environment be inhereted by child processes

By implementing add_exported function.

16 months agoImplement pipe duping
Lukas Jiriste [Thu, 1 Aug 2024 12:34:30 +0000 (14:34 +0200)]
Implement pipe duping

The order of closing the ends of pipes in ex_pipeline is done because
the reading end does not receive the eof unless the writting end is
closed. That means all file descriptors pointing to the writting end
have to be closed.
If the minishell itself only closes it after execution of the second
part of a pipe, it gets deadlocked, because minishell waits for the
process end to close the pipe and the process waits for the pipe to be
closed to exit.

16 months agoAllow execve to run
Lukas Jiriste [Thu, 1 Aug 2024 11:48:15 +0000 (13:48 +0200)]
Allow execve to run

This is done to test the implementation so far. Piping, redirections
and proper environment variables passing has to e implemented.

16 months agoFix not closing DIR
Lukas Jiriste [Thu, 1 Aug 2024 11:47:16 +0000 (13:47 +0200)]
Fix not closing DIR

16 months agoAdd the possibility to specify path to executable
Lukas Jiriste [Thu, 1 Aug 2024 11:05:33 +0000 (13:05 +0200)]
Add the possibility to specify path to executable

Before only the PATH was examined, now the field itself may contain the
path and minishell will recognize it.

16 months agoFix fields always ending with empty string
Lukas Jiriste [Thu, 1 Aug 2024 10:07:42 +0000 (12:07 +0200)]
Fix fields always ending with empty string

16 months agoUpdate Libft for a fix of invalid read in ft_split
Lukas Jiriste [Thu, 1 Aug 2024 10:06:34 +0000 (12:06 +0200)]
Update Libft for a fix of invalid read in ft_split

16 months agoAdd the structure of ex_fields, implement find_exe
Lukas Jiriste [Thu, 1 Aug 2024 10:02:07 +0000 (12:02 +0200)]
Add the structure of ex_fields, implement find_exe

The find_exe goes through the PATH variable of environment and looks
whether any of the directories contains the executable entered.

16 months agoFix here file delimiter recognition
Lukas Jiriste [Thu, 1 Aug 2024 07:52:57 +0000 (09:52 +0200)]
Fix here file delimiter recognition

Because the input line always contains newline character, it has to only
be compared to the last but one character.

16 months agoFix not freeing filename
Lukas Jiriste [Thu, 1 Aug 2024 07:48:48 +0000 (09:48 +0200)]
Fix not freeing filename

16 months agoMake sure t_vecs are initialized before free
Lukas Jiriste [Thu, 1 Aug 2024 07:30:06 +0000 (09:30 +0200)]
Make sure t_vecs are initialized before free

Short circuiting was meant to save the computation resources but causes
assignments not to be initialized when redirections encounter a problem.
This could be solved by initializing assignments outside of
save_assignments or by letting save_assignments initialize the
assignments even though it won't be used. I opted for the later.

16 months agoFix missing terminator null in assignment
Lukas Jiriste [Mon, 22 Jul 2024 20:55:40 +0000 (22:55 +0200)]
Fix missing terminator null in assignment

Instead there of terminating null there was a space left by the add_word
function. That also caused wrong concatenation of chained var expansions

16 months agoRemove interpreting unclosed quotes and \
Lukas Jiriste [Mon, 22 Jul 2024 20:43:19 +0000 (22:43 +0200)]
Remove interpreting unclosed quotes and \

As per the subject those should not be handled. Hence it is removed from
the tokenizer.