No description
Find a file
Khaïs COLIN 74f013e5c6
fix: do not read ahead in STDIN
The Open Group Base Specifications Issue 8 IEEE Std 1003.1-2024 sh — shell, the
standard command language interpreter says:

> When the shell is using standard input and it invokes a command that also uses
> standard input, the shell shall ensure that the standard input file pointer
> points directly after the command it has read when the command begins
> execution. It shall not read ahead in such a manner that any characters
> intended to be read by the invoked command are consumed by the shell (whether
> interpreted by the shell or not) or that characters that are not read by the
> invoked command are not seen by the shell.

We used the default BUFFER_SIZE for get_next_line of 1024, which caused us to
read ahead farther than was allowed by the Open Group Base Specification.

Setting BUFFER_SIZE=1 ensures that we don't read too far ahead, since
get_next_line will always immediatly stop once a newline is found.

This is for me the simplest way to solve this issue.
2025-04-02 19:27:30 +02:00
libft debug: remove *alloc/free debug information 2025-03-10 13:22:29 +00:00
src fix: double free when getting command path for empty command 2025-04-02 19:27:30 +02:00
tests here_doc: print error if failed to create temp file 2025-03-28 19:10:43 +01:00
.gitignore tests: implement a better integration test framework than shellspec 2025-03-28 14:50:37 +01:00
.valgrindrc valgrind: suppress readline still reachable leaks 2025-02-07 15:29:43 +01:00
interesting_tests.md Expansion : text replacement in a string 2025-03-21 10:04:25 +01:00
Makefile fix: do not read ahead in STDIN 2025-04-02 19:27:30 +02:00
NOTES.md cmdlist: use new architecture (STUB) 2025-03-28 14:50:37 +01:00
readline.supp leaks: ignore readline add_history leaks 2025-03-28 14:50:37 +01:00
test.sh fix: double free when getting command path for empty command 2025-04-02 19:27:30 +02:00