changeset 17233:98fcf9373f5e

octave-link.cc: Don't add 2 extra entries when using uigetfile (bug #39732). * libinterp/corefcn/octave-link.cc: Properly size return cell list.
author Rik <rik@octave.org>
date Mon, 12 Aug 2013 18:55:38 -0700
parents 090145ad5b4b
children 0b8f78cdc5cd
files libinterp/corefcn/octave-link.cc
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/octave-link.cc	Tue Aug 13 08:24:51 2013 -0400
+++ b/libinterp/corefcn/octave-link.cc	Mon Aug 12 18:55:38 2013 -0700
@@ -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<std::string>::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++;