net conf: adapt output of NULL share params in net conf list.
authorMichael Adam <obnox@samba.org>
Tue, 15 Apr 2008 15:36:44 +0000 (17:36 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 15 Apr 2008 15:40:27 +0000 (17:40 +0200)
don't list NULL share name and don't indent these parameters

Michael
(This used to be commit 0212b38913945ce3c8b14734804d81f1cd315621)

source3/utils/net_conf.c

index 293485aab147e945f50fdc34427e8a35c3ddc956..4fffcf8a8c25403bcad33c9064c2a0b62c699bc0 100644 (file)
@@ -246,11 +246,16 @@ static int net_conf_list(struct smbconf_ctx *conf_ctx,
        }
 
        for (share_count = 0; share_count < num_shares; share_count++) {
-               d_printf("[%s]\n", share_names[share_count]);
+               const char *indent = "";
+               if (share_names[share_count] != NULL) {
+                       d_printf("[%s]\n", share_names[share_count]);
+                       indent = "\t";
+               }
                for (param_count = 0; param_count < num_params[share_count];
                     param_count++)
                {
-                       d_printf("\t%s = %s\n",
+                       d_printf("%s%s = %s\n",
+                                indent,
                                 param_names[share_count][param_count],
                                 param_values[share_count][param_count]);
                }