X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=pscp.c;h=e56d760fbd7f09dc2d45f831fbc16efaea9ba1a6;hb=a063e522970946bf7d5dc052079d7773c0dee76d;hp=484c348e5e3ee3125eace28c5cb1d2f9b2ff6e6f;hpb=bb78583ad29084f16db994d66895917e1b20346e;p=PuTTY.git diff --git a/pscp.c b/pscp.c index 484c348e..e56d760f 100644 --- a/pscp.c +++ b/pscp.c @@ -370,15 +370,9 @@ static void do_cmd(char *host, char *user, char *cmd) bump("Empty host name"); /* - * Remove fiddly bits of address: remove a colon suffix, and - * the square brackets around an IPv6 literal address. + * Remove a colon suffix. */ - if (host[0] == '[') { - host++; - host[strcspn(host, "]")] = '\0'; - } else { - host[strcspn(host, ":")] = '\0'; - } + host[host_strcspn(host, ":")] = '\0'; /* * If we haven't loaded session details already (e.g., from -load), @@ -613,17 +607,7 @@ static char *colon(char *str) if (str[0] == '\0' || str[0] == ':' || (str[0] != '[' && str[1] == ':')) return (NULL); - while (*str != '\0' && *str != ':' && *str != '/' && *str != '\\') { - if (*str == '[') { - /* Skip over IPv6 literal addresses - * (eg: 'jeroen@[2001:db8::1]:myfile.txt') */ - char *ipv6_end = strchr(str, ']'); - if (ipv6_end) { - str = ipv6_end; - } - } - str++; - } + str += host_strcspn(str, ":/\\"); if (*str == ':') return (str); else @@ -2269,9 +2253,11 @@ static void usage(void) printf(" -1 -2 force use of particular SSH protocol version\n"); printf(" -4 -6 force use of IPv4 or IPv6\n"); printf(" -C enable compression\n"); - printf(" -i key private key file for authentication\n"); + printf(" -i key private key file for user authentication\n"); printf(" -noagent disable use of Pageant\n"); printf(" -agent enable use of Pageant\n"); + printf(" -hostkey aa:bb:cc:...\n"); + printf(" manually specify a host key (may be repeated)\n"); printf(" -batch disable all interactive prompts\n"); printf(" -unsafe allow server-side wildcards (DANGEROUS)\n"); printf(" -sftp force use of SFTP protocol\n");