xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit c470960ab3abd5b9d2c70062d7bd1d6c51f6359e

system, term, ...: correctly handle commands starting with `-`
Currently, at least with bash and zsh, vifm is unable to run a command
whose name starts with a dash (`-`) inside of a `term()` or `system()`
call:

zsh: bad option string: '-fd-compgen <...>'

Fix this by applying the idiomatic `--` guard to the shell invocation
(by convention and by POSIX, `--` denotes end of options).
Author: Ivan Shapovalov
Author date (UTC): 2024-04-11 17:41
Committer name: Ivan Shapovalov
Committer date (UTC): 2024-04-11 17:41
Parent(s): e95c30ab2669eee19efe0ea89045f6b8f0ab4ee0
Signing key:
Tree: fe429ff4fa763b64ee5e4ddfe8f778575dcc07af
File Lines added Lines deleted
src/utils/utils_nix.c 2 1
File src/utils/utils_nix.c changed (mode: 100644) (index 856d9fb47..eef5a6e3c)
... ... make_execv_array(char shell[], char shell_flag[], char cmd[])
358 358
359 359 char name[NAME_MAX + 1]; char name[NAME_MAX + 1];
360 360
361 char **args = reallocarray(NULL, 4 + npieces + 1, sizeof(*args));
361 char **args = reallocarray(NULL, 5 + npieces + 1, sizeof(*args));
362 362 char *eval_cmd; char *eval_cmd;
363 363 size_t len; size_t len;
364 364 size_t i; size_t i;
 
... ... make_execv_array(char shell[], char shell_flag[], char cmd[])
376 376 args[i++] = sh_arg; args[i++] = sh_arg;
377 377 } }
378 378 args[i++] = shell_flag; args[i++] = shell_flag;
379 args[i++] = "--";
379 380 args[i++] = cmd; args[i++] = cmd;
380 381 args[i++] = NULL; args[i++] = NULL;
381 382 return args; return args;
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master