mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-29 07:58:01 -04:00
tokenize: strdup() each individual argv
Instead of referencing the un-tokenized “raw” command string, strdup() each argv. This way, the input string can be ‘const’.
This commit is contained in:
parent
7632e16e36
commit
42ec264075
5 changed files with 56 additions and 38 deletions
4
slave.c
4
slave.c
|
|
@ -293,9 +293,7 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv,
|
|||
char **shell_argv = NULL;
|
||||
|
||||
if (argc == 0) {
|
||||
char *shell_copy = xstrdup(conf_shell);
|
||||
if (!tokenize_cmdline(shell_copy, &_shell_argv)) {
|
||||
free(shell_copy);
|
||||
if (!tokenize_cmdline(conf_shell, &_shell_argv)) {
|
||||
(void)!write(fork_pipe[1], &errno, sizeof(errno));
|
||||
_exit(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue