Revert "replace string_to_argv() with g_strsplit()"
This reverts commit 023473ac2557f37d842c81c67192feac1f898eb8. Conflicts: dunst.c
This commit is contained in:
parent
1a9c20ad63
commit
db27662e78
@ -12,6 +12,7 @@
|
||||
#include "option_parser.h"
|
||||
#include "settings.h"
|
||||
#include "config.h"
|
||||
#include "utils.h"
|
||||
|
||||
settings_t settings;
|
||||
|
||||
@ -174,7 +175,7 @@ void load_settings(char *cmdline_config_path)
|
||||
settings.dmenu =
|
||||
option_get_string("global", "dmenu", "-dmenu", dmenu,
|
||||
"path to dmenu");
|
||||
settings.dmenu_cmd = g_strsplit(dmenu, " ", 0);
|
||||
settings.dmenu_cmd = string_to_argv(settings.dmenu);
|
||||
|
||||
settings.browser =
|
||||
option_get_string("global", "browser", "-browser", browser,
|
||||
|
18
utils.c
18
utils.c
@ -68,6 +68,24 @@ char *string_append(char *a, const char *b, const char *sep)
|
||||
|
||||
}
|
||||
|
||||
char **string_to_argv(const char *s)
|
||||
{
|
||||
char *str = strdup(s);
|
||||
char **argv = NULL;
|
||||
char *p = strtok (str, " ");
|
||||
int n_spaces = 0;
|
||||
|
||||
while (p) {
|
||||
argv = realloc (argv, sizeof (char*) * ++n_spaces);
|
||||
argv[n_spaces-1] = p;
|
||||
p = strtok (NULL, " ");
|
||||
}
|
||||
argv = realloc (argv, sizeof (char*) * (n_spaces+1));
|
||||
argv[n_spaces] = NULL;
|
||||
|
||||
return argv;
|
||||
}
|
||||
|
||||
int digit_count(int i)
|
||||
{
|
||||
i = ABS(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user