From 376a3293de1efae68c66ea9a6be399b5403cfdb7 Mon Sep 17 00:00:00 2001 From: savalet Date: Mon, 28 Apr 2025 19:37:38 +0200 Subject: [PATCH] Add ? [ ] in globbing --- src/exec.c | 1 - src/globbing.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/exec.c b/src/exec.c index 0c07df2..05bd38d 100644 --- a/src/exec.c +++ b/src/exec.c @@ -23,7 +23,6 @@ #include "path.h" #include "u_mem.h" #include "u_str.h" -#include "alias.h" const builtins_funcs_t BUILTINS[] = { { "builtins", &builtins_builtins }, diff --git a/src/globbing.c b/src/globbing.c index 40be699..2b78391 100644 --- a/src/globbing.c +++ b/src/globbing.c @@ -48,7 +48,7 @@ bool process_args(ast_t *node, args_t *args, size_t *toks_i, ef_t *ef) { token_t tok = node->vector.tokens[*toks_i]; - if (strchr(tok.str, '*') != NULL) + if (strcspn(tok.str, "*[]?") != strlen(tok.str)) return (process_globbing(tok.str, args)); if (!ensure_args_capacity(args)) return false;