Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Improved the depth calculation in sanitize_path() so that it properly
[rsync/rsync.git]
/
util.c
diff --git
a/util.c
b/util.c
index
2212723
..
4b46b35
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-707,9
+707,12
@@
void sanitize_path(char *p, char *reldir)
int allowdotdot = 0;
if (reldir) {
-
depth++
;
+
int new_component = 1
;
while (*reldir) {
- if (*reldir++ == '/') {
+ if (*reldir++ == '/')
+ new_component = 1;
+ else if (new_component) {
+ new_component = 0;
depth++;
}
}