Commit graph

477 commits

Author SHA1 Message Date
b7686df5a8 fix(here_doc): do not display C-\ and C-<backspace> 2025-05-05 11:49:11 +02:00
083a2bb2a2 fix(here_doc): segfault when C-c 2025-05-02 14:52:08 +02:00
Jérôme Guélen
ee10abacab
Fixed grammar file for coherence and clarity 2025-05-02 13:32:08 +02:00
Jérôme Guélen
8b43fd2411
Norm: Removed most comments. 2025-05-02 13:16:26 +02:00
a7f09137ee fix(norm): remove extra files, do not compile in debug mode 2025-05-02 12:38:06 +02:00
5e8edb9a99 fix(norm): remove tests 2025-05-02 12:28:27 +02:00
313bef63fd fix(norm): remove fuzz code 2025-05-02 12:27:08 +02:00
b7e48cca05 fix(sig): incorrect handling of C-\
Closes #197
2025-05-02 12:22:04 +02:00
52c33abb16 fix(sig): incorrect retvalue when doing C-c on empty line
Now correctly return 130

Closes #196
2025-05-02 12:10:42 +02:00
ff3dfe3b84 fix(redir): ensure here_doc tmp files are always deleted 2025-04-30 18:03:17 +02:00
3a88cbbad4 fuzz: add hand tester 2025-04-30 18:03:17 +02:00
f0d7dcc752 fuzz: basic setup 2025-04-30 18:03:17 +02:00
58a27d712b tests: ensure some more specific tests work 2025-04-30 15:31:47 +02:00
826abdf623 fix(wildcard): error handling for wildcard expansion in redirections 2025-04-30 15:10:08 +02:00
04eabf096d fix(wildcard): error detection in wordlist_expand_star
Will help in closing #167
2025-04-30 14:55:12 +02:00
Jérôme Guélen
3ae29cbdf7
(fix) Prevented a potential SEGFAULT in expand_star 2025-04-30 14:25:45 +02:00
f8f3d8ccca fix(fork): handle fork error in all places 2025-04-30 14:07:10 +02:00
4b08629bef fix(pipe_cmd): check for fork failures 2025-04-30 11:52:05 +02:00
a8c3473b1a fix(norm): khais -> kcolin in headers
Closes #184
2025-04-30 11:29:20 +02:00
95451520d6 fix(redirection): prevent fd leak in subprocess when doing redirection with multiple processes 2025-04-30 10:36:08 +02:00
5ea55a9f9c fix(builtin/exit): prevent leak when calling exit in a subprocess 2025-04-29 15:55:34 +02:00
93f3ea7c66 fix(exec): prevent leak when calling exit() in a subprocess
This was because at the point at which exit is called, we can only free a
t_simple_cmd, but not the whole t_cmd tree. This commit introduces a convention
of returning a t_subprocess enum from each function in exec. If the current
thread is a subprocess, SUBPROCESS is returned, else PARENTPROCESS. We also no
longer call exit in subproceses. This way, all processes bubble up to main,
where if SUBPROCESS is returned, all memory is freed and the program exits.

This also removes the previous should_exit convention.

Still TODO: handling of the exit builtin, which should also bubble up in the
same way.
2025-04-29 15:20:05 +02:00
3c350af411 fix(debug): print messages to STDERR, to prevent redirection by pipes etc 2025-04-29 13:16:47 +02:00
Jérôme Guélen
5c53ebfa64 (fix) Quote removal on heredoc limiters 2025-04-28 21:37:31 +02:00
ab861fc5c0 tests(here-doc): ensure here docs work in many situations 2025-04-28 16:57:29 +02:00
aeb5105d97 tests(redir): ensure targets are expanded when no words are in the cmd 2025-04-28 16:28:04 +02:00
d4da91b62b fix(exec): do now swallow prompt and io on incorrect command followed by redirection 2025-04-28 16:07:08 +02:00
65c1eb9d84 fix(connec_cmd): handle nested connections correctly 2025-04-28 15:12:17 +02:00
92d647e33c feat(redirections): allow a command composed only of redirections 2025-04-28 14:44:20 +02:00
a9055b4c66 feat(redirection/group_cmd): handle redirections for group cmds 2025-04-28 13:01:08 +02:00
bd06d9f19c refactor(std_fds): allow for ability to store multiple std fds savesets 2025-04-28 12:49:13 +02:00
255a1382da fix(waitpid): remove spurious call & handle errors 2025-04-28 12:43:05 +02:00
505a96eeef refactor(redirections): make handle_redirections generic over cmd types 2025-04-28 12:43:05 +02:00
Jérôme Guélen
71eb07b4f5
(fix) Test was missing an EOF 2025-04-28 11:55:45 +02:00
Jérôme Guélen
32dd807c9d
(fix/enhancement): Added two tests for behaviour when not file corresponds 2025-04-28 11:50:36 +02:00
Jérôme Guélen
25ffc3fb6f
(fix): Proper behaviour for wildcards and proper test 2025-04-28 11:50:36 +02:00
Jérôme Guélen
e5952b3f43
Behaviour seems inconsistent 2025-04-28 11:50:32 +02:00
Jérôme Guélen
497f442d77
fix(expand-star): incomplete, committing to preserve 2025-04-28 11:48:13 +02:00
f0f19c3c0a fix(exec/and or): was exiting too soon 2025-04-25 18:03:12 +02:00
7a5e838fcf fix(debug): wrong indent for group_cmd 2025-04-25 17:53:40 +02:00
e1801652af fix(parsing/subshell): missing allocation for group cmd 2025-04-25 17:52:51 +02:00
9fcb34e1d5 feat(builtins/cd): on error, print path 2025-04-25 16:08:10 +02:00
29bbb5e572 fix(command_not_found): unset or empty PATH leads to No such file or directory error 2025-04-25 15:52:02 +02:00
c756d3783f tests(export): ensure export rejects invalid identifiers 2025-04-25 15:14:48 +02:00
c4be8693d1 tests(export): ensure export with extra = works 2025-04-25 15:10:05 +02:00
553783eb2d fix(tests): remove dependency on $HOME 2025-04-25 15:06:42 +02:00
f6ae16bbf8 tests(var_subst): ensure commands partially in variables work 2025-04-25 15:06:42 +02:00
a040ad5613 tests(export): ensure previous value of variable works correctly 2025-04-25 15:06:42 +02:00
Jérôme Guélen
29187f08da
tests(export/echo): ensure correct behaviour for single quotes in VAR 2025-04-25 15:01:54 +02:00
08baee41b6 tests(echo): ensure arguments in variables work 2025-04-25 14:40:09 +02:00