@@ -34,15 +34,7 @@
#include <regex.h>
#include "structs_vec.h"
#include "print.h"
-
-char *get_next_string(char **temp, char *split_char)
-{
- char *token = NULL;
- token = strsep(temp, split_char);
- while (token != NULL && !strcmp(token, ""))
- token = strsep(temp, split_char);
- return token;
-}
+#include "util.h"
#define CHECK_LEN \
do { \
@@ -63,6 +63,15 @@ filepresent (char * run) {
return 0;
}
+char *get_next_string(char **temp, char *split_char)
+{
+ char *token = NULL;
+ token = strsep(temp, split_char);
+ while (token != NULL && !strcmp(token, ""))
+ token = strsep(temp, split_char);
+ return token;
+}
+
int
get_word (char * sentence, char ** word)
{
@@ -6,6 +6,7 @@
size_t strchop(char *);
int basenamecpy (const char * src, char * dst, int);
int filepresent (char * run);
+char *get_next_string(char **temp, char *split_char);
int get_word (char * sentence, char ** word);
size_t strlcpy(char *dst, const char *src, size_t size);
size_t strlcat(char *dst, const char *src, size_t size);
The helper get_next_string is useful and generic. So move from exclusive weightedpath module to util module. It will be used in the next second patch. Signed-off-by: Junxiong Guan <guanjunxiong@huawei.com> --- libmultipath/prioritizers/weightedpath.c | 10 +--------- libmultipath/util.c | 9 +++++++++ libmultipath/util.h | 1 + 3 files changed, 11 insertions(+), 9 deletions(-)