mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-30 00:04:49 -05:00
Plink now honours the Default Settings protocol and supports -l for username.
Also removed a diagnostic which had got in by mistake. [originally from svn r668]
This commit is contained in:
parent
e424247802
commit
1139bbddd0
10
plink.c
10
plink.c
@ -162,9 +162,9 @@ int main(int argc, char **argv) {
|
|||||||
/*
|
/*
|
||||||
* Process the command line.
|
* Process the command line.
|
||||||
*/
|
*/
|
||||||
default_protocol = DEFAULT_PROTOCOL;
|
|
||||||
default_port = DEFAULT_PORT;
|
|
||||||
do_defaults(NULL);
|
do_defaults(NULL);
|
||||||
|
default_protocol = cfg.protocol;
|
||||||
|
default_port = cfg.port;
|
||||||
while (--argc) {
|
while (--argc) {
|
||||||
char *p = *++argv;
|
char *p = *++argv;
|
||||||
if (*p == '-') {
|
if (*p == '-') {
|
||||||
@ -177,7 +177,11 @@ int main(int argc, char **argv) {
|
|||||||
logfile = "putty.log";
|
logfile = "putty.log";
|
||||||
} else if (!strcmp(p, "-pw") && argc > 1) {
|
} else if (!strcmp(p, "-pw") && argc > 1) {
|
||||||
--argc, password = *++argv;
|
--argc, password = *++argv;
|
||||||
printf("pw is %s\n", password);
|
} else if (!strcmp(p, "-l") && argc > 1) {
|
||||||
|
char *username;
|
||||||
|
--argc, username = *++argv;
|
||||||
|
strncpy(cfg.username, username, sizeof(cfg.username));
|
||||||
|
cfg.username[sizeof(cfg.username)-1] = '\0';
|
||||||
} else if (!strcmp(p, "-P") && argc > 1) {
|
} else if (!strcmp(p, "-P") && argc > 1) {
|
||||||
--argc, portnumber = atoi(*++argv);
|
--argc, portnumber = atoi(*++argv);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user