This commit is contained in:
@@ -222,3 +222,28 @@ func evalSymlinks(in string) (string, error) {
|
||||
}
|
||||
return longFilenameSupport(out), nil
|
||||
}
|
||||
|
||||
// watchPaths adjust the folder root for use with the notify backend and the
|
||||
// corresponding absolute path to be passed to notify to watch name.
|
||||
func (f *BasicFilesystem) watchPaths(name string) (string, string, error) {
|
||||
root, err := evalSymlinks(f.root)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
// Remove `\\?\` prefix if the path is just a drive letter as a dirty
|
||||
// fix for https://github.com/syncthing/syncthing/issues/5578
|
||||
if filepath.Clean(name) == "." && len(root) <= 7 && len(root) > 4 && root[:4] == `\\?\` {
|
||||
root = root[4:]
|
||||
}
|
||||
|
||||
absName, err := rooted(name, root)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
root = f.resolveWin83(root)
|
||||
absName = f.resolveWin83(absName)
|
||||
|
||||
return filepath.Join(absName, "..."), root, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user