summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2013-10-12 19:32:04 +0200
committerAllan McRae <allan@archlinux.org>2013-10-14 05:01:15 +0200
commit0fc9545546cd6cff95ef32e043efbcbbf89ca89b (patch)
tree3c460a8d257b0d308de9fbda166bc7af3d5f0e7c /src/pacman/util.c
parent5477f2597b8763adc1ef4b1495e25f87107620c1 (diff)
downloadpacman-0fc9545546cd6cff95ef32e043efbcbbf89ca89b.tar.gz
pacman-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/util.c')
-rw-r--r--src/pacman/util.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 6da1cd40..0e9a4200 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -378,40 +378,6 @@ char *strreplace(const char *str, const char *needle, const char *replace)
return newstr;
}
-/** Splits a string into a list of strings using the chosen character as
- * a delimiter.
- *
- * @param str the string to split
- * @param splitchar the character to split at
- *
- * @return a list containing the duplicated strings
- */
-alpm_list_t *strsplit(const char *str, const char splitchar)
-{
- alpm_list_t *list = NULL;
- const char *prev = str;
- char *dup = NULL;
-
- while((str = strchr(str, splitchar))) {
- dup = strndup(prev, (size_t)(str - prev));
- if(dup == NULL) {
- return NULL;
- }
- list = alpm_list_add(list, dup);
-
- str++;
- prev = str;
- }
-
- dup = strdup(prev);
- if(dup == NULL) {
- return NULL;
- }
- list = alpm_list_add(list, dup);
-
- return list;
-}
-
static size_t string_length(const char *s)
{
int len;