update for [a,b] = getversion()
[scilab.git] / scilab / modules / core / src / c / inisci-c.c
index bb96644..a3986b3 100644 (file)
@@ -175,23 +175,14 @@ int C2F(gettmpdir)(char *buf,int *nbuf,long int lbuf)
 /*--------------------------------------------------------------------------*/
 BOOL ExistModelicac(void)
 {
-       // @ TO DO remove this
-       // used in getversion (compatibility)
-       #define FORMAT_SCIBIN_PATH "%s/bin/%s"
-       BOOL bOK=FALSE;
-       char *SCIPATH = (char*)getSCIpath();
-       char *fullpathModelicac=NULL;
-       int length_path = strlen(SCIPATH) + 
-                                       strlen(ModelicacName) + 
-                                       strlen(FORMAT_SCIBIN_PATH) + 1 ;
-       
-       fullpathModelicac=(char*)MALLOC((length_path)*sizeof(char));
-       sprintf(fullpathModelicac,FORMAT_SCIBIN_PATH,SCIPATH,ModelicacName);
-
-       bOK = FileExist(fullpathModelicac);
-       if (fullpathModelicac) FREE(fullpathModelicac);
-       if (SCIPATH) FREE(SCIPATH);
-       return bOK;
+       char *fullpathModelicac = searchEnv( ModelicacName,"PATH");
+       if (fullpathModelicac)
+       {
+               FREE(fullpathModelicac);
+               fullpathModelicac = NULL;
+               return TRUE;
+       }
+       return FALSE;
 }
 /*--------------------------------------------------------------------------*/
 int C2F(withgui)(int *rep)