Skip to content

Commit

Permalink
try to fix windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdaniels committed Sep 17, 2020
1 parent 4d39cfd commit d46f9ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ func Parent(u fyne.URI) (fyne.URI, error) {
// or NT sytle paths, with / or \, but when we reconstruct
// the URI, we want to have / only.
if runtime.GOOS == "windows" {
// seems that sometimes we end up with
// double-backslashes
parent = strings.ReplaceAll(parent, "\\\\", "/")
parent = strings.ReplaceAll(parent, "\\", "/")
}

Expand Down Expand Up @@ -167,7 +170,7 @@ func Child(u fyne.URI, component string) (fyne.URI, error) {
// return.
func Exists(u fyne.URI) (bool, error) {
if u.Scheme() != "file" {
return false, fmt.Errorf("Don't know how to check existence of %s scheme", u.Scheme())
return false, fmt.Errorf("don't know how to check existence of %s scheme", u.Scheme())
}

_, err := os.Stat(u.String()[len(u.Scheme())+3:])
Expand Down

0 comments on commit d46f9ff

Please sign in to comment.