summaryrefslogtreecommitdiffstats
path: root/scilab/modules/functions
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-02-12 10:10:35 +0100
committerAllan CORNET <allan.cornet@scilab.org>2010-02-12 10:10:35 +0100
commiteabb180eca981973e62bfade053b313efed114db (patch)
tree221b97b730046bffac23831b46865edeb91b2fda /scilab/modules/functions
parent0013cc1000e5eebaf266bb25122bc0450ee2a77c (diff)
downloadscilab-eabb180eca981973e62bfade053b313efed114db.zip
scilab-eabb180eca981973e62bfade053b313efed114db.tar.gz
expand path only if we need
Diffstat (limited to 'scilab/modules/functions')
-rw-r--r--scilab/modules/functions/sci_gateway/c/sci_lib.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/scilab/modules/functions/sci_gateway/c/sci_lib.c b/scilab/modules/functions/sci_gateway/c/sci_lib.c
index 89f36a3..0e58772 100644
--- a/scilab/modules/functions/sci_gateway/c/sci_lib.c
+++ b/scilab/modules/functions/sci_gateway/c/sci_lib.c
@@ -11,6 +11,7 @@
11* 11*
12*/ 12*/
13/*--------------------------------------------------------------------------*/ 13/*--------------------------------------------------------------------------*/
14#include <string.h>
14#include "stack-c.h" 15#include "stack-c.h"
15#include "gw_functions.h" 16#include "gw_functions.h"
16#include "api_scilab.h" 17#include "api_scilab.h"
@@ -20,6 +21,9 @@
20#include "machine.h" 21#include "machine.h"
21#include "FileExist.h" 22#include "FileExist.h"
22#include "getFullFilename.h" 23#include "getFullFilename.h"
24#ifdef _MSC_VER
25#include "strdup_windows.h"
26#endif
23/*--------------------------------------------------------------------------*/ 27/*--------------------------------------------------------------------------*/
24extern int C2F(intlib)(); 28extern int C2F(intlib)();
25/*--------------------------------------------------------------------------*/ 29/*--------------------------------------------------------------------------*/
@@ -108,7 +112,16 @@ int C2F(sci_lib)(char *fname,unsigned long fname_len)
108 } 112 }
109 } 113 }
110 114
111 fullfilename = getFullFilename(pStVarOne); 115 /* getfullfilename only if we need */
116 if (strchr(pStVarOne, '.') != NULL)
117 {
118 fullfilename = getFullFilename(pStVarOne);
119 }
120 else
121 {
122 fullfilename = strdup(pStVarOne);
123 }
124
112 if (fullfilename) 125 if (fullfilename)
113 { 126 {
114 if ((int)strlen(fullfilename) >= bsiz) 127 if ((int)strlen(fullfilename) >= bsiz)