param: remove duplicate lp_bool function
authorGarming Sam <garming@catalyst.net.nz>
Fri, 21 Feb 2014 02:18:33 +0000 (15:18 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:16 +0000 (19:49 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/param/loadparm.c
source3/param/loadparm.c

index ef745cf61b0c9ae270f6c8c5089d12662baa2efb..614b191c029988c8874d1b82d86ce24bf94381b4 100644 (file)
@@ -383,11 +383,11 @@ static double lp_double(const char *s)
 /**
  * convenience routine to return boolean parameters.
  */
-static bool lp_bool(const char *s)
+bool lp_bool(const char *s)
 {
        bool ret = false;
 
-       if (!s) {
+       if (!s || !*s) {
                DEBUG(0,("lp_bool(%s): is called with NULL!\n",s));
                return false;
        }
index 955d4898ca0a84cfee6ab14c177998af97eddf9c..4fbbdbe297144f67bee0cafef67578e91c6325f3 100644 (file)
@@ -1252,26 +1252,6 @@ static struct parmlist_entry *get_parametrics(int snum, const char *type,
 #define MISSING_PARAMETER(name) \
     DEBUG(0, ("%s(): value is NULL or empty!\n", #name))
 
-/*******************************************************************
-convenience routine to return boolean parameters.
-********************************************************************/
-static bool lp_bool(const char *s)
-{
-       bool ret = false;
-
-       if (!s || !*s) {
-               MISSING_PARAMETER(lp_bool);
-               return false;
-       }
-
-       if (!set_boolean(s, &ret)) {
-               DEBUG(0,("lp_bool(%s): value is not boolean!\n",s));
-               return false;
-       }
-
-       return ret;
-}
-
 /*******************************************************************
 convenience routine to return enum parameters.
 ********************************************************************/