multitudes / 42-minishell

This project is about creating a simple shell
MIT License
0 stars 0 forks source link

Open issues (pool) #200

Closed ProjektPhoenix closed 3 months ago

ProjektPhoenix commented 3 months ago

[DONE] [EDIT] I added back the token and it now return $ plus one digit only as DOLLAR_DIGIT

[DONE] Hard code $0 to expand to splash and the rest expands to nothing

ProjektPhoenix commented 3 months ago

[DONE] added the parm env array to history functions free(home) in history set up move set up history behind env setup consider using get_home again

ProjektPhoenix commented 3 months ago

[DONE] exit argument message: "argument" instead of "arguments" in error message

ProjektPhoenix commented 3 months ago

[DONE, i.e. not needed] place update_dollar_underscore function behind echo builtin

ProjektPhoenix commented 3 months ago

[done] use getcwd() to retrieve HOME if $HOME is not set use getcwd() to retrieve HOME did NOT WORK when started with env -i ./minishell

ProjektPhoenix commented 3 months ago

[DONE] cd .. cool swag fix exit status

ProjektPhoenix commented 3 months ago

[DONE] in function not_implemented_builtin(const char *id) correct ft_strncmp length

ProjektPhoenix commented 3 months ago

[DONE but needs further checks] move function restore fds inside execution of command, builtin, heredoc so not to execute it or perhaps better only in the execute list and before starting a new loop

ProjektPhoenix commented 3 months ago

[DONE] if exit status is 0, echo $? resolves to 0 and then echo $_ should give 0 instead of nothing

ProjektPhoenix commented 3 months ago

[DONE] heredoc should accept duplicate/repeating delimiters (they do not need to be different)

ProjektPhoenix commented 3 months ago

[DONE] if heredoc delimiter is ~ or other expansion, do not expand

-> add further tokens that should be treated as delimiters

ProjektPhoenix commented 3 months ago

[DONE] ~~"<<1 <<2" leads to double free in old heredoc implementation -> no such error in new heredoc implementation~~

ProjektPhoenix commented 3 months ago

executing "./minishell | minishell" in minishell leads to freeze

ProjektPhoenix commented 3 months ago

[DONE] single backslash as heredoc input gets ignored/removed

ProjektPhoenix commented 3 months ago

[FIXED] just * as command produced a segmentation fault with the files I had in the directory at the time, apparently in or after token merge in expansion UPDATE: no segmentation fault but lots of memory leaks !!!

multitudes commented 3 months ago

executing "./minishell | minishell" in minishell leads to freeze

it works now? just tried and it works

minishell: minishell command not found...

Oh ok, after that the bash freezes!

Start in bash and do bash | bash then do ./minishell

bash: line 3: $'\E[?2004l\r\E[?2004hminishell': command not found

Also doing again

bash | bash
ls

total mess

at least

c4c1c1% zsh | zsh
c4c1c1% ls
zsh: bad pattern: ^[[?1h^[=^[[?1l^[
c4c1c1% 
zle-line-init:printf:2: write error: broken pipe
zle-line-init:2: write error: broken pipe
c4c1c1% 
multitudes commented 3 months ago

EMPTY PARENTHESES I removed this check in the tokenizer and we can reintroduce it later

    if (is_empty_parenthesis(data->input, *i, start))
        return (scanner_error(data, "minishell: syntax error near unexpected token ')'"));
ProjektPhoenix commented 3 months ago

[SOLVED] unset "" test leads to memory leak of one byte, presumably through allocation in the double quote expansion also the function looks for "test" in env at index -1 (!?)

ProjektPhoenix commented 3 months ago

if "#" is found within valid parentheses, it should not be evaluated as a comment and lexing continued

multitudes commented 3 months ago

[FIXED kinda] check for empty parentheses when exiting the tokenizer () or '( ( ( ) ) ) but probably(((^^)))` is fine :)

multitudes commented 3 months ago

[FIXED] and the * as first token crashes the system :)

multitudes commented 3 months ago

[FIXED!] in heredoc $0 is not expanded @ProjektPhoenix