function part corrected. 38/11338/3
Cedric Delamarre [Fri, 19 Apr 2013 09:57:41 +0000 (11:57 +0200)]
part("toto",[])
part(["toto" "tutu"],[]) // size == 2

Change-Id: I4984e2ee79f361b8d4cb2eb55df7070393503000

scilab/modules/string/sci_gateway/cpp/sci_part.cpp

index cad4154..b958793 100644 (file)
@@ -74,14 +74,7 @@ Function::ReturnValue sci_part(typed_list &in, int _iRetCount, typed_list &out)
 
 
     Double* pD = in[1]->getAs<Double>();
-    if (pD->isEmpty())
-    {
-        out.push_back(new String(L""));
-        return Function::OK;
-    }
-
-
-    if (pD->isVector() == false)
+    if (pD->isVector() == false && pD->isEmpty() == false)
     {
         //non vector
         Scierror(999, _("%s: Wrong size for input argument #%d: A vector expected.\n"), "part", 2);