@@ -130,7 +130,7 @@ pub fn open_dialog(filter_list: Option<&str>, default_path: Option<&str>, dialog
130130 let ptr_out_path = & mut out_path as * mut * mut c_char ;
131131
132132 let mut out_multiple = nfdpathset_t:: default ( ) ;
133- let ptr_out_multyple = & mut out_multiple as * mut nfdpathset_t ;
133+ let ptr_out_multiple = & mut out_multiple as * mut nfdpathset_t ;
134134
135135 unsafe {
136136 result = match dialog_type {
@@ -139,7 +139,7 @@ pub fn open_dialog(filter_list: Option<&str>, default_path: Option<&str>, dialog
139139 } ,
140140
141141 DialogType :: MultipleFiles => {
142- NFD_OpenDialogMultiple ( filter_list_ptr, default_path_ptr, ptr_out_multyple )
142+ NFD_OpenDialogMultiple ( filter_list_ptr, default_path_ptr, ptr_out_multiple )
143143 } ,
144144
145145 DialogType :: SaveFile => {
@@ -149,9 +149,7 @@ pub fn open_dialog(filter_list: Option<&str>, default_path: Option<&str>, dialog
149149
150150 match result {
151151 nfdresult_t:: NFD_OKAY =>{
152- if dialog_type == DialogType :: SingleFile {
153- Ok ( Response :: Okay ( CStr :: from_ptr ( out_path) . to_string_lossy ( ) . into_owned ( ) ) )
154- } else {
152+ if dialog_type == DialogType :: MultipleFiles {
155153 let count = NFD_PathSet_GetCount ( & out_multiple) ;
156154 let mut res = Vec :: with_capacity ( count) ;
157155 for i in 0 ..count {
@@ -160,9 +158,11 @@ pub fn open_dialog(filter_list: Option<&str>, default_path: Option<&str>, dialog
160158
161159 }
162160
163- NFD_PathSet_Free ( ptr_out_multyple ) ;
161+ NFD_PathSet_Free ( ptr_out_multiple ) ;
164162
165163 Ok ( Response :: OkayMultiple ( res) )
164+ } else {
165+ Ok ( Response :: Okay ( CStr :: from_ptr ( out_path) . to_string_lossy ( ) . into_owned ( ) ) )
166166 }
167167 } ,
168168
0 commit comments