Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
e844a4a8
Commit
e844a4a8
authored
Oct 27, 2007
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When listing a bare module name w/o -r, make sure we list the
contents of the module's root directory.
parent
1d8638ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
clientserver.c
clientserver.c
+24
-10
main.c
main.c
+1
-1
No files found.
clientserver.c
View file @
e844a4a8
...
...
@@ -192,21 +192,31 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
int
start_inband_exchange
(
int
f_in
,
int
f_out
,
const
char
*
user
,
int
argc
,
char
*
argv
[])
{
int
i
;
int
i
,
modlen
;
char
line
[
BIGPATHBUFLEN
];
char
*
sargs
[
MAX_ARGS
];
int
sargc
=
0
;
char
*
p
,
*
path
=
*
argv
;
char
*
p
,
*
modname
;
if
(
argc
==
0
&&
!
am_sender
)
list_only
|=
1
;
assert
(
argc
>
0
);
if
(
*
path
==
'/'
)
{
if
(
*
*
argv
==
'/'
)
{
rprintf
(
FERROR
,
"ERROR: The remote path must start with a module name
\n
"
);
return
-
1
;
}
if
(
!
(
p
=
strchr
(
*
argv
,
'/'
)))
modlen
=
strlen
(
*
argv
);
else
modlen
=
p
-
*
argv
;
if
(
!
(
modname
=
new_array
(
char
,
modlen
+
1
+
1
)))
/* room for '/' & '\0' */
out_of_memory
(
"start_inband_exchange"
);
strlcpy
(
modname
,
*
argv
,
modlen
+
1
);
modname
[
modlen
]
=
'/'
;
modname
[
modlen
+
1
]
=
'\0'
;
if
(
!
user
)
user
=
getenv
(
"USER"
);
if
(
!
user
)
...
...
@@ -232,7 +242,12 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
rprintf
(
FERROR
,
"internal: args[] overflowed in do_cmd()
\n
"
);
exit_cleanup
(
RERR_SYNTAX
);
}
sargs
[
sargc
++
]
=
*
argv
++
;
if
(
list_only
&&
strncmp
(
*
argv
,
modname
,
modlen
)
==
0
&&
argv
[
0
][
modlen
]
==
'\0'
)
sargs
[
sargc
++
]
=
modname
;
/* we send "modname/" */
else
sargs
[
sargc
++
]
=
*
argv
;
argv
++
;
argc
--
;
}
...
...
@@ -241,10 +256,7 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
if
(
verbose
>
1
)
print_child_argv
(
"sending daemon args:"
,
sargs
);
p
=
strchr
(
path
,
'/'
);
if
(
p
)
*
p
=
'\0'
;
io_printf
(
f_out
,
"%s
\n
"
,
path
);
if
(
p
)
*
p
=
'/'
;
io_printf
(
f_out
,
"%.*s
\n
"
,
modlen
,
modname
);
/* Old servers may just drop the connection here,
rather than sending a proper EXIT command. Yuck. */
...
...
@@ -303,6 +315,8 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
io_start_multiplex_in
();
}
free
(
modname
);
return
0
;
}
...
...
main.c
View file @
e844a4a8
...
...
@@ -723,7 +723,7 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[])
argc
--
;
argv
++
;
if
(
argc
==
0
&&
(
recurse
||
list_only
))
{
if
(
argc
==
0
&&
(
recurse
||
xfer_dirs
||
list_only
))
{
argc
=
1
;
argv
--
;
argv
[
0
]
=
"."
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment