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:
Daniel Eklöf 2021-06-20 14:17:31 +02:00
parent 7632e16e36
commit 42ec264075
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 56 additions and 38 deletions

View file

@ -2,4 +2,4 @@
#include <stdbool.h>
bool tokenize_cmdline(char *cmdline, char ***argv);
bool tokenize_cmdline(const char *cmdline, char ***argv);