r14923: Return False in the case a parametrical option is not configured in
authorLars Müller <lmuelle@samba.org>
Wed, 5 Apr 2006 07:44:14 +0000 (07:44 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:54 +0000 (11:15 -0500)
the config file.

For a "somesettings: foo = " we still return an empty line.
(This used to be commit 59175ee522c5b4f9554ee734c008d8048eb1eadb)

source3/param/loadparm.c

index 95c095dcf23a02ce595c325edccb2eb0b84906a8..b7d6546fd9ae1886999316ef21e9245a22137669 100644 (file)
@@ -3883,6 +3883,7 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
        unsigned flag = 0;
        fstring local_parm_name;
        char *parm_opt;
+       const char *parm_opt_value;
 
        /* check for parametrical option */
        fstrcpy( local_parm_name, parm_name);
@@ -3892,9 +3893,12 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
                *parm_opt = '\0';
                parm_opt++;
                if (strlen(parm_opt)) {
-                       printf( "%s\n", lp_parm_const_string( snum,
-                               local_parm_name, parm_opt, ""));
-                       result = True;
+                       parm_opt_value = lp_parm_const_string( snum,
+                               local_parm_name, parm_opt, NULL);
+                       if (parm_opt_value) {
+                               printf( "%s\n", parm_opt_value);
+                               result = True;
+                       }
                }
                return result;
        }