summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-07-28 18:10:39 +0000
committerSimo Sorce <idra@samba.org>2002-07-28 18:10:39 +0000
commita4ec4acd61d58bca9c1f6d474ab16265e4113f7a (patch)
tree83a1ff7a5b26b4007e4479ed4e7466624292f0a0 /source3/lib
parent551d50c4e2bdde0b4f92001c92f8f69ffade44ad (diff)
downloadsamba-a4ec4acd61d58bca9c1f6d474ab16265e4113f7a.tar.gz
samba-a4ec4acd61d58bca9c1f6d474ab16265e4113f7a.tar.bz2
samba-a4ec4acd61d58bca9c1f6d474ab16265e4113f7a.zip
found nasty bug in intl/lang_tdb.c tdb structure was not tested to not be null before close
this one fixes swat not working with browsers that set more then one language. along the way implemented language priority in web/neg_lang.c with bubble sort also changet str_list_make to be able to use a different separator string Simo. (This used to be commit 69765e4faa8aaae74c97afc917891fc72d80703d)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c2
-rw-r--r--source3/lib/username.c2
-rw-r--r--source3/lib/util_str.c5
3 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index be5f66a562..842d2dac1d 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -423,7 +423,7 @@ BOOL debug_parse_levels(const char *params_str)
if (AllowDebugChange == False)
return True;
- params = str_list_make(params_str);
+ params = str_list_make(params_str, NULL);
if (debug_parse_params(params, DEBUGLEVEL_CLASS,
DEBUGLEVEL_CLASS_ISSET))
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 4813c8fd19..5db7f58b1e 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -163,7 +163,7 @@ BOOL map_username(char *user)
}
}
- dosuserlist = str_list_make(dosname);
+ dosuserlist = str_list_make(dosname, NULL);
if (!dosuserlist) {
DEBUG(0,("Unable to build user list\n"));
return False;
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 7e974269ec..9dc80c89db 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1125,7 +1125,7 @@ some platforms don't have strnlen
#define S_LIST_ABS 16 /* List Allocation Block Size */
-char **str_list_make(const char *string)
+char **str_list_make(const char *string, const char *sep)
{
char **list, **rlist;
char *str, *s;
@@ -1139,12 +1139,13 @@ char **str_list_make(const char *string)
DEBUG(0,("str_list_make: Unable to allocate memory"));
return NULL;
}
+ if (!sep) sep = LIST_SEP;
num = lsize = 0;
list = NULL;
str = s;
- while (next_token(&str, tok, LIST_SEP, sizeof(tok))) {
+ while (next_token(&str, tok, sep, sizeof(tok))) {
if (num == lsize) {
lsize += S_LIST_ABS;
rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1)));