[FIX] inhibitors

This commit is contained in:
tekClovis
2025-05-08 20:15:04 +02:00
parent c077f2fe97
commit 5d628534b1
2 changed files with 4 additions and 6 deletions

View File

@@ -101,7 +101,7 @@ bool compare_to_close(ast_ctx_t *ctx, token_t acutal_tok)
if (!*ctx->str && !(*ctx->str + 1))
return false;
for (size_t i = 0; i < TOKENS_LIST_SZ; i++) {
if (u_strncmp(ctx->str, TOKENS_LIST[i].str,
if (u_strncmp((ctx->str + 1), TOKENS_LIST[i].str,
TOKENS_LIST[i].sz) == 0) {
token = TOKENS_LIST[i].type;
break;

View File

@@ -96,13 +96,12 @@ bool format_quotes(ast_t *node, char be_matched, size_t *i)
if (isblank(last_quote[1]) || be_matched == '`'){
last_quote[0] = '\0';
return true;
} else
node->vector.tokens[*i].str[node->vector.tokens[*i].sz - 1] = '\0';
}
memmove(&last_quote[0], &last_quote[1], strlen(last_quote));
last_quote = strchr(node->vector.tokens[*i].str, be_matched);
if (strchr(node->vector.tokens[*i].str, be_matched))
return (fprintf(stderr, "Unmatched \'%c\'.\n", be_matched), false);
node->vector.tokens[*i].str[node->vector.tokens[*i].sz - 2] = '\0';
node->vector.tokens[*i].str[node->vector.tokens[*i].sz] = '\0';
return true;
}
@@ -115,8 +114,7 @@ bool check_quotes(ast_t *node, size_t *i, exec_ctx_t *ctx, args_t *args)
return true;
if (node->vector.tokens[*i].sz == 1)
return (fprintf(stderr, "Unmatched \'%c\'.\n", be_matched), true);
memmove(&node->vector.tokens[*i].str[0],
&node->vector.tokens[*i].str[1], node->vector.tokens[*i].sz);
node->vector.tokens[*i].str++;
if (!format_quotes(node, be_matched, i))
return true;
if (be_matched == '`')