From 0fc9545546cd6cff95ef32e043efbcbbf89ca89b Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 12 Oct 2013 13:32:04 -0400 Subject: pacman/util: remove strsplit strsplit was used in only one place and did the same thing as strtok. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/pacman.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 24fd57f4..d2114e69 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -325,14 +325,14 @@ static void handler(int signum) static int parsearg_util_addlist(alpm_list_t **list) { - alpm_list_t *split, *item; + char *i, *save; check_optarg(); - split = strsplit(optarg, ','); - for(item = split; item; item = alpm_list_next(item)) { - *list = alpm_list_add(*list, item->data); + + for(i = strtok_r(optarg, ",", &save); i; i = strtok_r(NULL, ",", &save)) { + *list = alpm_list_add(*list, strdup(i)); } - alpm_list_free(split); + return 0; } -- cgit v1.2.3-54-g00ecf