Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ff1b934
)
The [ & ] are now removed from a literal IPv6 hostname passed to the
author
Wayne Davison
<wayned@samba.org>
Mon, 18 Sep 2006 17:39:13 +0000
(17:39 +0000)
committer
Wayne Davison
<wayned@samba.org>
Mon, 18 Sep 2006 17:39:13 +0000
(17:39 +0000)
remote shell.
options.c
patch
|
blob
|
blame
|
history
diff --git
a/options.c
b/options.c
index
ec57901
..
44b7b03
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-1780,10
+1780,10
@@
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
{
char *p;
int not_host;
{
char *p;
int not_host;
+ int hostlen;
if (port_ptr && strncasecmp(URL_PREFIX, s, strlen(URL_PREFIX)) == 0) {
char *path;
if (port_ptr && strncasecmp(URL_PREFIX, s, strlen(URL_PREFIX)) == 0) {
char *path;
- int hostlen;
s += strlen(URL_PREFIX);
if ((p = strchr(s, '/')) != NULL) {
hostlen = p - s;
s += strlen(URL_PREFIX);
if ((p = strchr(s, '/')) != NULL) {
hostlen = p - s;
@@
-1811,6
+1811,8
@@
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
}
if (*s == '[' && (p = strchr(s, ']')) != NULL && p[1] == ':') {
}
if (*s == '[' && (p = strchr(s, ']')) != NULL && p[1] == ':') {
+ s++;
+ hostlen = p - s;
*p = '\0';
not_host = strchr(s, '/') || !strchr(s, ':');
*p = ']';
*p = '\0';
not_host = strchr(s, '/') || !strchr(s, ':');
*p = ']';
@@
-1820,6
+1822,7
@@
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
} else {
if (!(p = strchr(s, ':')))
return NULL;
} else {
if (!(p = strchr(s, ':')))
return NULL;
+ hostlen = p - s;
*p = '\0';
not_host = strchr(s, '/') != NULL;
*p = ':';
*p = '\0';
not_host = strchr(s, '/') != NULL;
*p = ':';
@@
-1827,8
+1830,8
@@
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
return NULL;
}
return NULL;
}
- *host_ptr = new_array(char,
p - s
+ 1);
- strlcpy(*host_ptr, s,
p - s
+ 1);
+ *host_ptr = new_array(char,
hostlen
+ 1);
+ strlcpy(*host_ptr, s,
hostlen
+ 1);
if (p[1] == ':') {
if (port_ptr && !*port_ptr)
if (p[1] == ':') {
if (port_ptr && !*port_ptr)