Jérôme Guélen
532f9dc526
libft: add free2 function
...
This frees two pointers, and returns NULL
2025-02-19 14:34:09 +01:00
Jérôme Guélen
622a9caa53
refactor: move env_get_size to env_get.c
2025-02-19 14:34:09 +01:00
Jérôme Guélen
30d32a1d53
ft_errno: integrate ft_errno library
2025-02-19 14:34:09 +01:00
Jérôme Guélen
660d785237
ENV: A small set of functions for internal env
2025-02-19 14:34:09 +01:00
18a2835a7c
tests: add testutils
2025-02-19 14:34:09 +01:00
Jérôme Guélen
5b00059526
refactor: rename env_get_set.c to env_get.c
2025-02-19 14:34:09 +01:00
ab6a4d6368
envp_get_val: add tests + make it more consistent with envp_get_key
...
In particular, this is what is now changed:
- if line is null or empty, return null
- if line contains no =, return an empty string
This way, if non-null is returned, that means that line was valid. If null is
returned, there is either an error with line, or malloc failed.
2025-02-19 14:34:09 +01:00
af90bec318
envp_get_key: fix buffer overflow if line contains no '='
2025-02-19 14:34:09 +01:00
9ac8588518
envp_get_key: add tests
2025-02-19 14:34:09 +01:00
aad17031a8
libft: add ft_strcmp function
2025-02-19 14:34:09 +01:00
897f6c6a6b
fix(Makefile): ASAN malloc stacktraces were being truncated
2025-02-19 14:34:09 +01:00
a6ce45ca87
tests Makefile: add rules to run C tests iwth specific sanitizer
2025-02-19 14:34:08 +01:00
c7a86eecfd
tests: tests can now use libft
2025-02-19 14:34:08 +01:00
da447a2491
env_manip: make it compile
2025-02-19 14:34:08 +01:00
Jérôme Guélen
f0a181315b
WIP: env: getting key and value from an envp entry
2025-02-19 14:34:08 +01:00
Jérôme Guélen
eaa1afda5f
WIP: internal environment manipulation
...
Added a function to join two strings putting a separator in between. (Predicted useful for PATH manipulation and general translation of internal structure back to char ** form)
2025-02-19 14:34:08 +01:00
46401ef417
libft: do not override default CC
...
instead use the one provided by the system, which allows easier integration of
tools such as distcc and ccache
jguelen: you probably don't have to worry about anything here
2025-02-19 14:34:08 +01:00
9cc5c6bfb7
dev: ignore .cache and compile_commands.json
...
These files are used by clangd to know where code is located.
To generate them, use
bear -- make re
and restart your lsp
jguelen: you probably don't have to deal with this
2025-02-19 13:56:09 +01:00
9bab2b26d8
notes: add Bash Hackers Wiki resource
2025-02-13 15:42:02 +01:00
0ec5f5a66a
notes: add IEEE spec resource
2025-02-13 15:42:02 +01:00
2aa49363eb
notes: reading input in non-interactive mode needs to be done char by char
2025-02-13 15:42:02 +01:00
67ffe772b0
Makefile: add rule to run only C tests
2025-02-13 15:42:02 +01:00
394a923fdc
Merge branch 'notes'
2025-02-12 17:44:16 +01:00
8d728b04e1
notes: document behaviour we need to implement so that we can use prysk
2025-02-12 17:29:34 +01:00
80e0484005
Merge branch 'libft'
2025-02-12 17:25:48 +01:00
c027eda58c
notes: add some usefull resources
2025-02-12 17:18:19 +01:00
2d03d208e8
fix(Makefile): norm should check the libft
2025-02-12 17:01:43 +01:00
35ffa6f3a0
fix(libft): in case of tests, build with -fsanitize as well
2025-02-12 15:21:40 +01:00
9e9bd1043b
fix(libft): compilation failed due to different compiler version
2025-02-12 15:18:17 +01:00
Jérôme Guélen
ddb2306630
libs: added libft
2025-02-12 15:12:42 +01:00
6e1552a35d
fix: ';' is not a metacharacter
...
Co-authored-by: jguelen <jguelen@student.42lehavre.fr>
2025-02-11 19:04:05 +01:00
e877b8dbd5
fix(tests): correctly handle dependencies in test makefile
2025-02-11 18:47:46 +01:00
ac905d0674
notes: finish last operation
2025-02-11 16:57:06 +01:00
71a4df1bb0
fix: stdio needs to be included before readline for compilation to work
2025-02-11 16:38:49 +01:00
9292d802e5
nix: gitignore compile_flags.txt
2025-02-11 16:19:19 +01:00
0db1867a55
notes: add signals section (WIP - needs to be investigated further)
2025-02-11 16:05:10 +01:00
b450220720
notes: add exit status section
2025-02-11 16:05:10 +01:00
6672aec007
decision: not sure if we will implement shell script execution, it is not subject-required
2025-02-11 16:05:10 +01:00
d72613c29f
decision: in heredoc, we will not ignore \newline
2025-02-11 16:05:10 +01:00
0637a637b9
notes: clarify here doc section and move it to the correct place
2025-02-11 16:05:10 +01:00
78298fbb1d
notes: decide to follow regular bash behaviour, not POSIX
2025-02-11 16:05:10 +01:00
806e98ac97
notes: clarified note about parameter expansion in here doc
...
Still need to see if we have to implement that..
2025-02-11 16:05:10 +01:00
e6e108a98d
notes: remove $* and $@ mention, since we do not have to implement them
2025-02-11 16:05:10 +01:00
b10f2a2ec8
notes: add environment section
2025-02-11 16:05:10 +01:00
a8ff648139
notes: add executing commands section
2025-02-11 16:05:10 +01:00
845c0adb6a
fix(notes): we actually don't have to handle ';'
2025-02-11 16:05:10 +01:00
9c81ac832a
notes: add an interesting case of shell variables vs environment variables
2025-02-11 16:05:10 +01:00
f3c875c34e
gitignore: do not commit bash reference manual
2025-02-11 16:05:10 +01:00
Khaïs COLIN
4e7e7b85a7
notes: add small signal handling section
...
I noticed a small oddity in handling, so I took a note
2025-02-07 17:32:16 +01:00
Khaïs COLIN
eff1eede66
notes: add redirection section
...
Signed-off-by: Khaïs COLIN <kcolin@student.42lehavre.fr>
2025-02-07 17:32:16 +01:00