mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
merge from 2.2 - fix parsing of options
(This used to be commit c849e93392
)
This commit is contained in:
parent
62299aa747
commit
361d0f9f7b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user