mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-05 21:24:44 -06:00
Avoid filepath.Dir as it returns paths with back slashes on Windows
This commit is contained in:
@@ -18,7 +18,6 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
//"net/http/httputil"
|
//"net/http/httputil"
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -360,11 +359,12 @@ func (storage *WebDAVStorage) MoveFile(threadIndex int, from string, to string)
|
|||||||
|
|
||||||
// createParentDirectory creates the parent directory if it doesn't exist in the cache
|
// createParentDirectory creates the parent directory if it doesn't exist in the cache
|
||||||
func (storage *WebDAVStorage) createParentDirectory(threadIndex int, dir string) (err error) {
|
func (storage *WebDAVStorage) createParentDirectory(threadIndex int, dir string) (err error) {
|
||||||
parent := filepath.Dir(dir)
|
|
||||||
|
|
||||||
if parent == "." {
|
found := strings.LastIndex(dir, "/")
|
||||||
|
if found == -1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
parent := dir[:found]
|
||||||
|
|
||||||
storage.directoryCacheLock.Lock()
|
storage.directoryCacheLock.Lock()
|
||||||
_, exist := storage.directoryCache[parent]
|
_, exist := storage.directoryCache[parent]
|
||||||
|
|||||||
Reference in New Issue
Block a user