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:
3104620
)
Fixed a bug in clean_fname() that could sometimes leave a "dir/.."
author
Wayne Davison
<wayned@samba.org>
Sat, 7 Aug 2004 20:56:41 +0000
(20:56 +0000)
committer
Wayne Davison
<wayned@samba.org>
Sat, 7 Aug 2004 20:56:41 +0000
(20:56 +0000)
sequence uncollapsed.
util.c
patch
|
blob
|
blame
|
history
diff --git
a/util.c
b/util.c
index
a878720
..
28a00ef
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-652,7
+652,7
@@
size_t stringjoin(char *dest, size_t destsize, ...)
unsigned int clean_fname(char *name)
{
unsigned int clean_fname(char *name)
{
- char *limit = name, *t = name, *f = name;
+ char *limit = name
- 1
, *t = name, *f = name;
int anchored;
if (!name)
int anchored;
if (!name)
@@
-669,7
+669,7
@@
unsigned int clean_fname(char *name)
if (*f == '.') {
/* discard "." dirs (but NOT a trailing '.'!) */
if (f[1] == '/') {
if (*f == '.') {
/* discard "." dirs (but NOT a trailing '.'!) */
if (f[1] == '/') {
- f
++; /* not += 2! */
+ f
+= 2;
continue;
}
/* collapse ".." dirs */
continue;
}
/* collapse ".." dirs */
@@
-680,7
+680,7
@@
unsigned int clean_fname(char *name)
continue;
}
while (s > limit && *--s != '/') {}
continue;
}
while (s > limit && *--s != '/') {}
- if (s != t - 1 &&
*s == '/'
) {
+ if (s != t - 1 &&
(s < name || *s == '/')
) {
t = s + 1;
f += 2;
continue;
t = s + 1;
f += 2;
continue;