This commit is contained in:
Nuno Cruces 2021-02-22 19:04:55 +00:00
parent 3296597158
commit f433dd524c

View file

@ -243,7 +243,7 @@ func pickFolders(opts options, multi bool) (str string, lst []string, err error)
uintptr(unsafe.Pointer(&item))) uintptr(unsafe.Pointer(&item)))
if hr >= 0 && item != nil { if hr >= 0 && item != nil {
dialog.Call(dialog.vtbl.SetDefaultFolder, uintptr(unsafe.Pointer(item))) dialog.Call(dialog.vtbl.SetFolder, uintptr(unsafe.Pointer(item)))
item.Call(item.vtbl.Release) item.Call(item.vtbl.Release)
} }
} }
@ -362,12 +362,12 @@ func initDirNameExt(filename string, name []uint16) (dir *uint16, ext *uint16) {
d, n := splitDirAndName(filename) d, n := splitDirAndName(filename)
e := filepath.Ext(n) e := filepath.Ext(n)
if n != "" { if n != "" {
copy(name, syscall.StringToUTF16(n)) copy(name, syscall.StringToUTF16(filename))
} }
if d != "" { if d != "" {
dir = syscall.StringToUTF16Ptr(d) dir = syscall.StringToUTF16Ptr(d)
} }
if e != "" { if len(e) > 1 {
ext = syscall.StringToUTF16Ptr(e[1:]) ext = syscall.StringToUTF16Ptr(e[1:])
} }
return return