Skip to content

Commit

Permalink
Avoid calling os.Create in file open dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
lusingander authored and andydotxyz committed Jul 8, 2020
1 parent 44606fb commit 550fbc9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/driver/glfw/file.go
Expand Up @@ -36,7 +36,12 @@ func openFile(uri fyne.URI, create bool) (*file, error) {
}

path := uri.String()[7:]
f, err := os.Create(path) // If it exists this will truncate which is what we wanted

var f *os.File
var err error
if create {
f, err = os.Create(path) // If it exists this will truncate which is what we wanted
} else {
f, err = os.Open(path)
}
return &file{File: f, path: path}, err
}

4 comments on commit 550fbc9

@Niek
Copy link

@Niek Niek commented on 550fbc9 Jul 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be released as v1.3.2? Because it's quite a dangerous bug

@andydotxyz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s in v1.3.1

@Niek
Copy link

@Niek Niek commented on 550fbc9 Jul 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I missed that - my bad. Edit: somehow it's not included in v1.3.1, see #1182 (comment)

@andydotxyz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were some proxy cache issues so I tagged v1.3.2 with this definitely added

Please sign in to comment.