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:
42ccb4c
)
A few improvements to the new check_for_hostspec() function.
author
Wayne Davison
<wayned@samba.org>
Tue, 1 Mar 2005 05:49:11 +0000
(
05:49
+0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 1 Mar 2005 05:49:11 +0000
(
05:49
+0000)
options.c
patch
|
blob
|
blame
|
history
diff --git
a/options.c
b/options.c
index
ea35841
..
8a02d4f
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-1490,17
+1490,16
@@
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
if (*s == '[' && (p = strchr(s, ']')) != NULL) {
s++;
hostlen = p - s;
if (*s == '[' && (p = strchr(s, ']')) != NULL) {
s++;
hostlen = p - s;
- if (*p == ':')
- *port_ptr = atoi(p+1);
- else if (!*port_ptr)
- *port_ptr = RSYNC_PORT;
+ if (p[1] == ':')
+ *port_ptr = atoi(p+2);
} else {
if ((p = strchr(s, ':')) != NULL) {
hostlen = p - s;
*port_ptr = atoi(p+1);
} else {
if ((p = strchr(s, ':')) != NULL) {
hostlen = p - s;
*port_ptr = atoi(p+1);
- } else if (!*port_ptr)
- *port_ptr = RSYNC_PORT;
+ }
}
}
+ if (!*port_ptr)
+ *port_ptr = RSYNC_PORT;
*host_ptr = new_array(char, hostlen + 1);
strlcpy(*host_ptr, s, hostlen + 1);
return path;
*host_ptr = new_array(char, hostlen + 1);
strlcpy(*host_ptr, s, hostlen + 1);
return path;
@@
-1513,6
+1512,7
@@
char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
*p = ']';
if (not_host)
return NULL;
*p = ']';
if (not_host)
return NULL;
+ p++;
} else {
if (!(p = strchr(s, ':')))
return NULL;
} else {
if (!(p = strchr(s, ':')))
return NULL;