fix: infinit loop 'echo '> >> < * ? [ ] | ; [ ] || && ( ) & # $ <<''

This commit is contained in:
starnakin 2023-07-04 17:06:06 +02:00
parent 98341b62bc
commit db60e7adba

View File

@ -85,7 +85,7 @@ int get_redirections(char *str, cmd* command)
{ {
redirection = strchr(redirection, redirection_symbol[i]); redirection = strchr(redirection, redirection_symbol[i]);
while (redirection != NULL && is_in_quote(str, redirection - str)) while (redirection != NULL && is_in_quote(str, redirection - str))
redirection = strchr(redirection, '>'); redirection = strchr(redirection + 2, redirection_symbol[i]);
if (redirection == NULL) if (redirection == NULL)
break; break;
redirection_type = get_concecutive(redirection); redirection_type = get_concecutive(redirection);