allow one output argument with fileparts 44/16444/3
Charlotte HECQUET [Tue, 5 May 2015 14:11:40 +0000 (16:11 +0200)]
[path,fname,extension]=fileparts('SCI/etc/scilab.start')
[path,fname]=fileparts('SCI/etc/scilab.start')
path=fileparts('SCI/etc/scilab.start')

Change-Id: Ied183704222af83194cc7fd51799670cd30e2268

scilab/modules/fileio/sci_gateway/cpp/sci_fileparts.cpp

index 0febd50..64ef331 100644 (file)
@@ -179,8 +179,24 @@ Function::ReturnValue sci_fileparts(typed_list &in, int _iRetCount, typed_list &
         }
 
         out.push_back(pStrOut);
-        out.push_back(pStrOut2);
-        out.push_back(pStrOut3);
+        if (_iRetCount > 1)
+        {
+            out.push_back(pStrOut2);
+            if (_iRetCount == 3)
+            {
+                out.push_back(pStrOut3);
+            }
+            else
+            {
+                delete(pStrOut3);
+
+            }
+        }
+        else
+        {
+            delete(pStrOut2);
+            delete(pStrOut3);
+        }
     }
 
     return Function::OK;