From 4be643d4ce33d5ce2bf9deacc3f6d0fde90cf626 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 9 Mar 2011 16:34:49 +0100 Subject: lib: Move next_token next to next_token_talloc Signed-off-by: Jeremy Allison --- lib/util/charset/util_unistr.c | 47 ------------------------------------------ 1 file changed, 47 deletions(-) (limited to 'lib/util/charset/util_unistr.c') diff --git a/lib/util/charset/util_unistr.c b/lib/util/charset/util_unistr.c index 6737256a95..ddb15f88f9 100644 --- a/lib/util/charset/util_unistr.c +++ b/lib/util/charset/util_unistr.c @@ -21,53 +21,6 @@ #include "includes.h" #include "system/locale.h" -/** - * Get the next token from a string, return False if none found. - * Handles double-quotes. - * - * Based on a routine by GJC@VILLAGE.COM. - * Extensively modified by Andrew.Tridgell@anu.edu.au - **/ -_PUBLIC_ bool next_token(const char **ptr,char *buff, const char *sep, size_t bufsize) -{ - const char *s; - bool quoted; - size_t len=1; - - if (!ptr) - return false; - - s = *ptr; - - /* default to simple separators */ - if (!sep) - sep = " \t\n\r"; - - /* find the first non sep char */ - while (*s && strchr_m(sep,*s)) - s++; - - /* nothing left? */ - if (!*s) - return false; - - /* copy over the token */ - for (quoted = false; len < bufsize && *s && (quoted || !strchr_m(sep,*s)); s++) { - if (*s == '\"') { - quoted = !quoted; - } else { - len++; - *buff++ = *s; - } - } - - *ptr = (*s) ? s+1 : s; - *buff = 0; - - return true; -} - - /** String replace. NOTE: oldc and newc must be 7 bit characters -- cgit