mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
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
1 changed files with 8 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue