summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-06 18:53:00 -0800
committerJeremy Allison <jra@samba.org>2008-11-06 18:53:00 -0800
commit8b4b5c3a92be83e99d9177b04f0da56f610025de (patch)
tree7ee4a9729d64a7eb52db84c01b4bb65d7fd4c252 /source3/lib
parent2c5a9f0a57774b861439390ab86b48c3f0475af8 (diff)
downloadsamba-8b4b5c3a92be83e99d9177b04f0da56f610025de.tar.gz
samba-8b4b5c3a92be83e99d9177b04f0da56f610025de.tar.bz2
samba-8b4b5c3a92be83e99d9177b04f0da56f610025de.zip
Add wrapper str_list_make_v3() to replace the old S3 behavior of
str_list_make(). From Dan Sledz <dan.sledz@isilon.com>: In samba 3.2 passing NULL or an empty string returned NULL. In master, it now returns a list of length 1 with the first string set to NULL (an empty list). Jeremy.
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c2
-rw-r--r--source3/lib/util_str.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 986dff48d7..d64fcb66d9 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -472,7 +472,7 @@ bool debug_parse_levels(const char *params_str)
if (AllowDebugChange == False)
return True;
- params = str_list_make(talloc_tos(), params_str, NULL);
+ params = str_list_make_v3(talloc_tos(), params_str, NULL);
if (debug_parse_params(params)) {
debug_dump_status(5);
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 046ce61ea3..fde4f825e8 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -2532,3 +2532,19 @@ char *escape_shell_string(const char *src)
*dest++ = '\0';
return ret;
}
+
+/***************************************************
+ Wrapper for str_list_make() to restore the s3 behavior.
+ In samba 3.2 passing NULL or an empty string returned NULL.
+
+ In master, it now returns a list of length 1 with the first string set
+ to NULL (an empty list)
+***************************************************/
+
+char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
+{
+ if (!string || !*string) {
+ return NULL;
+ }
+ return str_list_make(mem_ctx, string, sep);
+}