mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-03-12 03:17:09 -04:00
Handle nested "." dirs (caused by --relative and a trailing slash or
a trailing "/.") in f_name_cmp() when dirname is not an identical pointer.
This commit is contained in:
14
flist.c
14
flist.c
@@ -1680,8 +1680,13 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
|
||||
break;
|
||||
case s_SLASH:
|
||||
type1 = S_ISDIR(f1->mode) ? t_path : t_ITEM;
|
||||
state1 = s_BASE;
|
||||
c1 = (uchar*)f1->basename;
|
||||
if (type1 == t_PATH && *c1 == '.' && !c1[1]) {
|
||||
type1 = t_ITEM;
|
||||
state1 = s_TRAILING;
|
||||
c1 = (uchar*)"";
|
||||
} else
|
||||
state1 = s_BASE;
|
||||
break;
|
||||
case s_BASE:
|
||||
state1 = s_TRAILING;
|
||||
@@ -1705,8 +1710,13 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
|
||||
break;
|
||||
case s_SLASH:
|
||||
type2 = S_ISDIR(f2->mode) ? t_path : t_ITEM;
|
||||
state2 = s_BASE;
|
||||
c2 = (uchar*)f2->basename;
|
||||
if (type2 == t_PATH && *c2 == '.' && !c2[1]) {
|
||||
type2 = t_ITEM;
|
||||
state2 = s_TRAILING;
|
||||
c2 = (uchar*)"";
|
||||
} else
|
||||
state2 = s_BASE;
|
||||
break;
|
||||
case s_BASE:
|
||||
state2 = s_TRAILING;
|
||||
|
||||
Reference in New Issue
Block a user