frontend: PATH_MAX includes the terminating null char
parser: consume final newline in expect_here_document
Fixes the last part of .
parser: consume symbol in expect_here_document
parser: parse here-documents after newline separator
Fixes part of .
ast: print here_document in print_io_redirect
parser: fix mrsh_parser.here_documents memory leak
Makefile: remove getopt.h from public_includes
Fixes 'make install' failing since getopt.h was made private
parser/word: add NULL guards to prevent segfault
ci: automate sr.ht annotations generation
Check error even when mrsh_parse_program returns non-NULL
In the future, I'd like to make mrsh_parse_program return the
partially-parsed program on error to allow interactive shells to provide
syntax highlighting while typing.
Only handle continuation lines when interactive
test: overhaul conformance tests
This introduces comprehensive conformance testing for section 2.2 of the
POSIX shell standard. However, note that mrsh does not currently pass
these new tests. For what it's worth, neither does dash.
parser/word: fix parser not failing on some errors in back-quotes
shell/task/simple_command: return 127 on command not found
parser: disable aliases when processing command substitutions
Only split fields on expansion/substitution results
test/args: ensure getopts doesn't modify main scope
Use a subshell to ensure the OPTIND variable is reset between function
calls. This fixes the Alpine and FreeBSD builds.
ensure argv passed to getopt is NULL terminated
This has two fixes, 1: in push_frame allocates an extra array
element, and uses calloc instead of malloc to ensure that element is
NULL. 2: in argv_dup, enough memory is allocated but, the last element
is left uninitialized. By using calloc instead, the last element is
guaranteed to be NULL.
I also added a test for this, although it does not always fail since it
relies on undefined behavior.