File filters have extra ; and missing \0 (windows) (#113)
Co-authored-by: Nuno Cruces <ncruces@users.noreply.github.com>
This commit is contained in:
parent
ee06172a03
commit
848f6d01d3
1 changed files with 3 additions and 2 deletions
|
@ -282,7 +282,7 @@ func fileOpenDialog(opts options, multi bool) (string, []string, bool, error) {
|
|||
}
|
||||
|
||||
var lst []string
|
||||
for i := uint32(0); i < count && err == nil; i++ {
|
||||
for i := uint32(0); i < count; i++ {
|
||||
str, err := shellItemPath(items.GetItemAt(i))
|
||||
if err != nil {
|
||||
return "", nil, true, err
|
||||
|
@ -499,7 +499,7 @@ func initFilters(filters FileFilters) *uint16 {
|
|||
res = append(res, syscall.StringToUTF16(p)...)
|
||||
res[len(res)-1] = ';'
|
||||
}
|
||||
res = append(res, 0)
|
||||
res[len(res)-1] = 0
|
||||
}
|
||||
if res != nil {
|
||||
res = append(res, 0)
|
||||
|
@ -521,6 +521,7 @@ func initFileTypes(filters FileFilters) (int, *win.COMDLG_FILTERSPEC) {
|
|||
spec = append(spec, syscall.StringToUTF16(p)...)
|
||||
spec[len(spec)-1] = ';'
|
||||
}
|
||||
spec[len(spec)-1] = 0
|
||||
res = append(res, win.COMDLG_FILTERSPEC{
|
||||
Name: syscall.StringToUTF16Ptr(f.Name),
|
||||
Spec: &spec[0],
|
||||
|
|
Loading…
Reference in a new issue