Use str_list_equal() rather than str_list_compare().
authorJelmer Vernooij <jelmer@samba.org>
Sat, 18 Oct 2008 13:56:07 +0000 (15:56 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 18 Oct 2008 13:56:07 +0000 (15:56 +0200)
source3/include/proto.h
source3/lib/util_str.c
source3/param/loadparm.c
source3/web/swat.c

index cab294d8b1bf5434e78f1d47966bfac652b8b48f..ac900233fa2bca6458dbf1c6a5df72229a75971b 100644 (file)
@@ -1664,7 +1664,7 @@ char *binary_string(char *buf, int len);
 int fstr_sprintf(fstring s, const char *fmt, ...);
 char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
 char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
-bool str_list_compare(char **list1, char **list2);
+bool str_list_equal(const char **list1, const char **list2);
 size_t str_list_length( const char * const*list );
 bool str_list_sub_basic( char **list, const char *smb_name,
                         const char *domain_name );
index 5d1893a85b511deb75a5c34961aef991458ce636..80aaa2b9c02a3ee54cb64e89d95b95204fd046d0 100644 (file)
@@ -1843,29 +1843,6 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
 
 #define S_LIST_ABS 16 /* List Allocation Block Size */
 
-/**
- * Return true if all the elements of the list match exactly.
- **/
-bool str_list_compare(char **list1, char **list2)
-{
-       int num;
-
-       if (!list1 || !list2)
-               return (list1 == list2);
-
-       for (num = 0; list1[num]; num++) {
-               if (!list2[num])
-                       return false;
-               if (!strcsequal(list1[num], list2[num]))
-                       return false;
-       }
-       if (list2[num])
-               return false; /* if list2 has more elements than list1 fail */
-
-       return true;
-}
-
-
 /******************************************************************************
  version of standard_sub_basic() for string lists; uses talloc_sub_basic()
  for the work
index 3401bd16a0870210ca00e9b4cd5353bb72676e1a..d91d34d29bfab55e42e7bbd488346cee699e7ea1 100644 (file)
@@ -7423,7 +7423,7 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2)
                        return (*((char *)ptr1) == *((char *)ptr2));
 
                case P_LIST:
-                       return str_list_compare(*(char ***)ptr1, *(char ***)ptr2);
+                       return str_list_equal(*(const char ***)ptr1, *(const char ***)ptr2);
 
                case P_STRING:
                case P_USTRING:
@@ -7512,8 +7512,8 @@ static bool is_default(int i)
                return False;
        switch (parm_table[i].type) {
                case P_LIST:
-                       return str_list_compare (parm_table[i].def.lvalue, 
-                                               *(char ***)parm_table[i].ptr);
+                       return str_list_equal((const char **)parm_table[i].def.lvalue, 
+                                               *(const char ***)parm_table[i].ptr);
                case P_STRING:
                case P_USTRING:
                        return strequal(parm_table[i].def.svalue,
index 23fc43f776936abbecb60a6212150c6042a23483..27c4b54e2fd1a6e7a6b80b1850278b3606118f59 100644 (file)
@@ -384,7 +384,8 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte
                                        break;
 
                                case P_LIST:
-                                       if (!str_list_compare(*(char ***)ptr, (char **)(parm->def.lvalue))) continue;
+                                       if (!str_list_equal(*(const char ***)ptr, 
+                                                           (const char **)(parm->def.lvalue))) continue;
                                        break;
 
                                case P_STRING: