Skip to content

Commit 6490da6

Browse files
lib/list.c: comma_to_list(): Use build_list() instead of its pattern
Signed-off-by: Alejandro Colomar <[email protected]>
1 parent db034e0 commit 6490da6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/list.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <config.h>
1010

11-
#ident "$Id$"
11+
#include <stdlib.h>
1212

1313
#include <assert.h>
1414

@@ -18,7 +18,6 @@
1818
#include "string/strcmp/streq.h"
1919
#include "string/strdup/xstrdup.h"
2020
#include "string/strtok/astrsep2ls.h"
21-
#include "string/strtok/xastrsep2ls.h"
2221

2322

2423
/*
@@ -198,10 +197,10 @@ comma_to_list(const char *comma)
198197

199198
members = xstrdup (comma);
200199

201-
array = xastrsep2ls(members, ",", &n);
200+
array = build_list(members);
201+
if (array == NULL)
202+
exit(EXIT_FAILURE);
202203

203-
if (streq(array[n-1], ""))
204-
array[n-1] = NULL;
205204
if (array[0] == NULL)
206205
free(members);
207206

0 commit comments

Comments
 (0)