From 94ff22b129aeb31c38848231e40f87aa4a5613a1 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 17 Apr 2008 21:56:54 +0300 Subject: Eliminate splitString() and freeSplitString() - use ARGV_t instead, it does the same and more... --- rpmio/rpmstring.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'rpmio/rpmstring.c') diff --git a/rpmio/rpmstring.c b/rpmio/rpmstring.c index ac9b5cf34..08d44b46a 100644 --- a/rpmio/rpmstring.c +++ b/rpmio/rpmstring.c @@ -26,49 +26,6 @@ char * stripTrailingChar(char * s, char c) return s; } -char ** splitString(const char * str, size_t length, char sep) -{ - const char * source; - char * s, * dest; - char ** list; - int i; - int fields; - - s = xmalloc(length + 1); - - fields = 1; - for (source = str, dest = s, i = 0; i < length; i++, source++, dest++) { - *dest = *source; - if (*dest == sep) fields++; - } - - *dest = '\0'; - - list = xmalloc(sizeof(*list) * (fields + 1)); - - dest = s; - list[0] = dest; - i = 1; - while (i < fields) { - if (*dest == sep) { - list[i++] = dest + 1; - *dest = 0; - } - dest++; - } - - list[i] = NULL; - -/* FIX: list[i] is NULL */ - return list; -} - -void freeSplitString(char ** list) -{ - list[0] = _free(list[0]); - list = _free(list); -} - StringBuf newStringBuf(void) { StringBuf sb = xmalloc(sizeof(*sb)); -- cgit v1.2.3