From 361d0f9f7b5c2568e64123b72c602aa6a07b66e5 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 26 Feb 2002 20:04:54 +0000 Subject: merge from 2.2 - fix parsing of options (This used to be commit c849e93392e3206b010949566a65a339f5064031) --- source3/rpcclient/rpcclient.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'source3') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 47a36b6dda..7cb56fe5e4 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -566,10 +566,26 @@ static void usage(void) struct cmd_set **cmd_set; struct in_addr server_ip; NTSTATUS nt_status; + extern BOOL AllowDebugChange; setlinebuf(stdout); DEBUGLEVEL = 1; + AllowDebugChange = False; + + /* Parse options */ + if (argc == 0) { + usage(); + return 0; + } + + if (strncmp("//", argv[1], 2) == 0 || strncmp("\\\\", argv[1], 2) == 0) + argv[1] += 2; + + pstrcpy(server, argv[1]); + + argv++; + argc--; while ((opt = getopt(argc, argv, "A:s:Nd:U:W:c:l:h")) != EOF) { switch (opt) { @@ -625,20 +641,6 @@ static void usage(void) } } - argv += optind; - argc -= optind; - - /* Parse options */ - if (argc == 0) { - usage(); - return 0; - } - - if (strncmp("//", argv[0], 2) == 0 || strncmp("\\\\", argv[0], 2) == 0) - argv[0] += 2; - - pstrcpy(server, argv[0]); - /* the following functions are part of the Samba debugging facilities. See lib/debug.c */ setup_logging("rpcclient", interactive); -- cgit