Merge pull request #750 from schollz:schollz/issue574
Sending folders from the root of a drive always goes to the same path on the receiver's end
This commit is contained in:
commit
8577745d74
|
|
@ -421,8 +421,14 @@ func GetFilesInfo(fnames []string, zipfolder bool, ignoreGit bool) (filesInfo []
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
remoteFolder := strings.TrimPrefix(filepath.Dir(pathName),
|
absPathWithSeparator := filepath.Dir(absPath)
|
||||||
filepath.Dir(absPath)+string(os.PathSeparator))
|
if !strings.HasSuffix(absPathWithSeparator, string(os.PathSeparator)) {
|
||||||
|
absPathWithSeparator += string(os.PathSeparator)
|
||||||
|
}
|
||||||
|
if strings.HasSuffix(absPathWithSeparator, string(os.PathSeparator)+string(os.PathSeparator)) {
|
||||||
|
absPathWithSeparator = strings.TrimSuffix(absPathWithSeparator, string(os.PathSeparator))
|
||||||
|
}
|
||||||
|
remoteFolder := strings.TrimPrefix(filepath.Dir(pathName), absPathWithSeparator)
|
||||||
if !info.IsDir() {
|
if !info.IsDir() {
|
||||||
fInfo := FileInfo{
|
fInfo := FileInfo{
|
||||||
Name: info.Name(),
|
Name: info.Name(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue