summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-08 12:02:40 +1000
committerAndrew Tridgell <tridge@samba.org>2011-04-13 14:47:07 +1000
commit2eea91957c90d6a5960b5350d2c4664812260a7b (patch)
tree792b34f76b72f3b7e0ade24b5f0b03bae30bb4f9 /source3
parent9941dfe9f6532ecbc317685046d74e6f90c41695 (diff)
downloadsamba-2eea91957c90d6a5960b5350d2c4664812260a7b.tar.gz
samba-2eea91957c90d6a5960b5350d2c4664812260a7b.tar.bz2
samba-2eea91957c90d6a5960b5350d2c4664812260a7b.zip
lib/util Move simple string routines into common code.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in3
-rw-r--r--source3/lib/util_str.c49
2 files changed, 2 insertions, 50 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index a0503278b9..2c74ff8cf4 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -450,7 +450,8 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
lib/access.o lib/smbrun.o \
lib/bitmap.o lib/dprintf.o $(UTIL_REG_OBJ) \
lib/wins_srv.o \
- lib/util_str.o ../lib/util/base64.o lib/util_sid.o \
+ lib/util_str.o ../lib/util/util_str_common.o \
+ ../lib/util/base64.o lib/util_sid.o \
../lib/util/charset/util_unistr_w.o ../lib/util/charset/codepoints.o ../lib/util/charset/util_str.o lib/util_file.o \
lib/util.o lib/util_cmdline.o lib/util_names.o \
lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 0f75f45bf1..a710fcc35b 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -209,36 +209,6 @@ bool strnequal(const char *s1,const char *s2,size_t n)
}
/**
-Do a case-insensitive, whitespace-ignoring string compare.
-**/
-
-int strwicmp(const char *psz1, const char *psz2)
-{
- /* if BOTH strings are NULL, return TRUE, if ONE is NULL return */
- /* appropriate value. */
- if (psz1 == psz2)
- return (0);
- else if (psz1 == NULL)
- return (-1);
- else if (psz2 == NULL)
- return (1);
-
- /* sync the strings on first non-whitespace */
- while (1) {
- while (isspace((int)*psz1))
- psz1++;
- while (isspace((int)*psz2))
- psz2++;
- if (toupper_ascii(*psz1) != toupper_ascii(*psz2) ||
- *psz1 == '\0' || *psz2 == '\0')
- break;
- psz1++;
- psz2++;
- }
- return (*psz1 - *psz2);
-}
-
-/**
Convert a string to "normal" form.
**/
@@ -1635,25 +1605,6 @@ void string_append(char **left, const char *right)
safe_strcat(*left, right, new_len-1);
}
-bool add_string_to_array(TALLOC_CTX *mem_ctx,
- const char *str, const char ***strings,
- int *num)
-{
- char *dup_str = talloc_strdup(mem_ctx, str);
-
- *strings = TALLOC_REALLOC_ARRAY(mem_ctx, *strings,
- const char *, (*num)+1);
-
- if ((*strings == NULL) || (dup_str == NULL)) {
- *num = 0;
- return false;
- }
-
- (*strings)[*num] = dup_str;
- *num += 1;
- return true;
-}
-
/* Append an sprintf'ed string. Double buffer size on demand. Usable without
* error checking in between. The indiation that something weird happened is
* string==NULL */