diff options
author | Herb Lewis <herb@samba.org> | 2002-02-26 20:04:54 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2002-02-26 20:04:54 +0000 |
commit | c849e93392e3206b010949566a65a339f5064031 (patch) | |
tree | 268950063862e5b26eba9b6826ab1e29aceac0e7 | |
parent | 330b0df960329bcf4696b8fa4a7357e6c456f74e (diff) | |
download | samba-c849e93392e3206b010949566a65a339f5064031.tar.gz samba-c849e93392e3206b010949566a65a339f5064031.tar.xz samba-c849e93392e3206b010949566a65a339f5064031.zip |
merge from 2.2 - fix parsing of options
-rw-r--r-- | source/rpcclient/rpcclient.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c index 47a36b6ddac..7cb56fe5e4f 100644 --- a/source/rpcclient/rpcclient.c +++ b/source/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); |