summaryrefslogtreecommitdiffstats
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-10-12 13:32:04 -0400
committerAllan McRae <allan@archlinux.org>2013-10-14 13:01:15 +1000
commit0fc9545546cd6cff95ef32e043efbcbbf89ca89b (patch)
tree3c460a8d257b0d308de9fbda166bc7af3d5f0e7c /src/pacman/pacman.c
parent5477f2597b8763adc1ef4b1495e25f87107620c1 (diff)
downloadpacman-0fc9545546cd6cff95ef32e043efbcbbf89ca89b.tar.xz
pacman/util: remove strsplit
strsplit was used in only one place and did the same thing as strtok. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c10
1 files changed, 5 insertions, 5 deletions
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;
}