# HG changeset patch # User Rik # Date 1376358938 25200 # Node ID 98fcf9373f5e48139625159d0547476a7cf79386 # Parent 090145ad5b4b0bc7e51bc1af04eb0f8628b2705d octave-link.cc: Don't add 2 extra entries when using uigetfile (bug #39732). * libinterp/corefcn/octave-link.cc: Properly size return cell list. diff --git a/libinterp/corefcn/octave-link.cc b/libinterp/corefcn/octave-link.cc --- a/libinterp/corefcn/octave-link.cc +++ b/libinterp/corefcn/octave-link.cc @@ -231,7 +231,7 @@ retval.resize (3); - // If 3, then is filename, directory and selected index. + // If 3, then retval is filename, directory, and selected index. if (nel <= 3) { int idx = 0; @@ -250,12 +250,12 @@ else { // Multiple files. - nel = items_lst.size (); + nel = items_lst.size () - 2; Cell items (dim_vector (1, nel)); std::list::iterator it = items_lst.begin (); - for (unsigned int idx = 0; idx < items_lst.size ()-2; idx++) + for (unsigned int idx = 0; idx < nel; idx++) { items.xelem (idx) = *it; it++;