[PATCH] Remove odd trailing spaces from 'net share' output

SATOH Fumiyasu fumiya at miraclelinux.com
Mon Feb 9 08:53:20 GMT 2004


Hi,

This is a patch for Samba 3.0.1 to remove odd trailing space(s)
from 'net share (without --long option)' output if sharename
length is less than 12byte, and to fix doubled output problem in
'net rap share --long' output.

Please apply this patch to Samba 3.0.x tree. Questions?

-- 
-- Name: SATOH Fumiyasu  -- Home: http://www.sfo.jp (in Japanese only)
-- Mail: fumiya at net-thrust.com, samba.gr.jp, namazu.org or ...

Index: source/utils/net_rap.c
===================================================================
RCS file: /work/cvs/samba/source/utils/net_rap.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 net_rap.c
--- source/utils/net_rap.c	23 Oct 2003 03:53:56 -0000	1.1.1.1
+++ source/utils/net_rap.c	9 Feb 2004 08:32:28 -0000
@@ -160,7 +160,7 @@ static void long_share_fn(const char *sh
 static void share_fn(const char *share_name, uint32 type, 
 		     const char *comment, void *state)
 {
-	d_printf("%-12.12s\n", share_name);
+	d_printf("%s\n", share_name);
 }
 
 static int rap_share_delete(int argc, const char **argv)
@@ -240,8 +240,9 @@ int net_rap_share(int argc, const char *
 	"\nShare name   Type     Description\n"\
 	"----------   ----     -----------\n");
 			ret = cli_RNetShareEnum(cli, long_share_fn, NULL);
+		} else {
+			ret = cli_RNetShareEnum(cli, share_fn, NULL);
 		}
-		ret = cli_RNetShareEnum(cli, share_fn, NULL);
 		cli_shutdown(cli);
 		return ret;
 	}
Index: source/utils/net_rpc.c
===================================================================
RCS file: /work/cvs/samba/source/utils/net_rpc.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 net_rpc.c
--- source/utils/net_rpc.c	16 Dec 2003 01:11:39 -0000	1.1.1.2
+++ source/utils/net_rpc.c	9 Feb 2004 08:32:28 -0000
@@ -1344,7 +1344,7 @@ static void display_share_info_1(SRV_SHA
 		d_printf("%-12.12s %-8.8s %-50.50s\n",
 			 netname, share_type[info1->info_1.type], remark);
 	} else {
-		d_printf("%-12.12s\n", netname);
+		d_printf("%s\n", netname);
 	}
 
 }


More information about the samba-technical mailing list