Open alexey-sderzhikov opened 1 year ago
Hm… yeah, this splitting and cleaning path code doesn’t seem to be in the original. In this specific path, it just returns []string{pattern}, nil
.
Not sure what we can update by porting the current code over again. 🤔 But this at least is something we should probably fix.
If we use pattern with trailing slash, like
"/home/"
and such object exist, thansftp.Glob
duplicates object's name, and returns "/home/home". It happens becausec.Lstat(pattern)
finds existing object with trailing slash, butSplit(pattern)
doesn't split dir and object, and thenJoin(dir, file.Name())
joins duplicates.I'am not sure how it should to work, but i think current logic not properly right. May i help?