diff --git a/README.md b/README.md index 107eb2a..47003f3 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,9 @@ - [x] redirections - [ ] line editing (move, del, multi-line) - [ ] input shortcut (^A,^E,^R,^V,^F,^B,...) -- [ ] color highlighting in input - [ ] foreground/background jobs (`&`), (btln `fg`, `bg`, `jobs`) -- [ ] while/for/foreach loops -- [ ] if / cases +- [x] while/foreach loops +- [x] if - [x] `||`/`&&` - [ ] configuration file - [x] script with shebangs @@ -40,19 +39,13 @@ - [ ] `-e` exit on failure - [ ] `-n` (dry run mode) - [ ] `-h` help (open man?) -- [ ] autocompletion of commands - [x] globbing -- [ ] var interpreter -- [ ] inhibitor -- [ ] magic quotes -- [ ] parenthesis (sub-commands) -- [ ] direnv/wakatime integration +- [x] var interpreter +- [x] inhibitor +- [x] magic quotes +- [x] parenthesis - [x] command history (`history` btln) -- [ ] arithmetric expansion (`$(( x + 1 ))`) -- [ ] brace expansion: `{a,b,c}` and `{1..10}` - [x] heredocs - [ ] functions (`:() { :|:& }`) - [ ] special env vars: `$?`, `$$`, ... - [ ] git integration (branch) -- [ ] `x`, `e`, `o` & pipefail modes -- [ ] file inquiry operators (`-d`, `f`, ...) diff --git a/src/exec.c b/src/exec.c index f4dcc1a..38ca266 100644 --- a/src/exec.c +++ b/src/exec.c @@ -75,7 +75,7 @@ char **parse_args(ef_t *ef, ast_t *node) * DEFAULT_ARGS_CAP), .sz = 0, .cap = DEFAULT_ARGS_CAP }; if (!args.args) - return NULL; + return nullptr; for (size_t i = 0; i < node->vector.sz; i++) { if (ef->skip_sz > 0 && i >= ef->skip_i && i < ef->skip_i + ef->skip_sz) continue; @@ -83,8 +83,8 @@ char **parse_args(ef_t *ef, ast_t *node) return free((void *)args.args), NULL; } if (!ensure_args_capacity(&args)) - return NULL; - args.args[args.sz] = NULL; + return nullptr; + args.args[args.sz] = nullptr; return args.args; }