Skip to content

Commit 60da35a

Browse files
committed
- Fixed the spaces problem.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11808 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent e1994a7 commit 60da35a

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

Compiler/Script/CevalScript.mo

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ algorithm
18751875
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
18761876
// create the list of arguments for OMPlot
18771877
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --legend=" +& boolString(legend) +& " --grid=" +& boolString(grid) +& " --plotAll --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow);
1878-
call = str2 +& " " +& str3;
1878+
call = stringAppendList({"\"",str2,"\""," ",str3});
18791879

18801880
0 = System.spawnCall(str2, call);
18811881
then
@@ -1961,7 +1961,7 @@ algorithm
19611961
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
19621962
// create the list of arguments for OMPlot
19631963
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --legend=" +& boolString(legend) +& " --grid=" +& boolString(grid) +& " --plot --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " \"" +& str +& "\"";
1964-
call = str2 +& " " +& str3;
1964+
call = stringAppendList({"\"",str2,"\""," ",str3});
19651965

19661966
0 = System.spawnCall(str2, call);
19671967
then
@@ -2041,7 +2041,7 @@ algorithm
20412041
str2 = stringAppendList({omhome,pd,"bin",pd,"OMVisualize",s1});
20422042
// create the list of arguments for OMVisualize
20432043
str3 = "--visualizationfile=\"" +& str1 +& "\" --simulationfile=\"" +& filename +& "\"" +& " --new-window=" +& boolString(externalWindow);
2044-
call = str2 +& " " +& str3;
2044+
call = stringAppendList({"\"",str2,"\""," ",str3});
20452045

20462046
0 = System.spawnCall(str2, call);
20472047
then
@@ -2280,7 +2280,7 @@ algorithm
22802280
str2 = stringAppendList({omhome,pd,"bin",pd,"OMPlot",s1});
22812281
// create the list of arguments for OMPlot
22822282
str3 = "--filename=\"" +& filename +& "\" --title=\"" +& title +& "\" --legend=" +& boolString(legend) +& " --grid=" +& boolString(grid) +& " --plotParametric --logx=" +& boolString(logX) +& " --logy=" +& boolString(logY) +& " --xlabel=\"" +& xLabel +& "\" --ylabel=\"" +& yLabel +& "\" --xrange=" +& realString(x1) +& ":" +& realString(x2) +& " --yrange=" +& realString(y1) +& ":" +& realString(y2) +& " --new-window=" +& boolString(externalWindow) +& " \"" +& str +& "\"";
2283-
call = str2 +& " " +& str3;
2283+
call = stringAppendList({"\"",str2,"\""," ",str3});
22842284

22852285
0 = System.spawnCall(str2, call);
22862286
then
@@ -3076,12 +3076,10 @@ algorithm
30763076
// to the environment variable! Don't ask me why, ask Microsoft.
30773077
isWindows = System.os() ==& "Windows_NT";
30783078
omhome = Util.if_(isWindows, "set OPENMODELICAHOME=\"" +& System.stringReplace(omhome_1, "/", "\\") +& "\"&& ", "");
3079-
win_call = stringAppendList({omhome,
3080-
omhome_1,pd,"share",pd,"omc",pd,"scripts",pd,"Compile"," ",fileprefix," ",noClean});
3079+
win_call = stringAppendList({omhome,"\"",omhome_1,pd,"share",pd,"omc",pd,"scripts",pd,"Compile","\""," ",fileprefix," ",noClean});
30813080
make = System.getMakeCommand();
30823081
make_call = stringAppendList({make," -f ",fileprefix,".makefile >",fileprefix,".log 2>&1"});
30833082
s_call = Util.if_(isWindows, win_call, make_call);
3084-
30853083
Debug.fprintln(Flags.DYN_LOAD, "compileModel: running " +& s_call);
30863084

30873085
// remove .exe .dll .log!
@@ -3094,11 +3092,10 @@ algorithm
30943092

30953093
// call the system command to compile the model!
30963094
0 = System.systemCall(s_call);
3097-
3095+
30983096
Debug.fprintln(Flags.DYN_LOAD, "compileModel: successful! ");
30993097
then
31003098
();
3101-
31023099
case (fileprefix,libs,file_dir,_,_) /* compilation failed */
31033100
equation
31043101
filename = stringAppendList({fileprefix,".log"});

Compiler/scripts/Compile.bat

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ REM It is not certain that release OMC is installed
1111
if not %OMDEV%a==a set MINGW=%OMDEV%\tools\MinGW
1212
REM echo OPENMODELICAHOME = %OPENMODELICAHOME% > %1.log 2>&1
1313
REM echo MINGW = %MINGW% >%1.log 2>&1
14-
set CURRENT_DIR="%CD%">%1.log 2>&1
15-
cd /D "%MINGW%\bin" >>"%CURRENT_DIR%\%1.log" 2>&1
16-
set PATH=%CD%;%CD%\..\libexec\gcc\mingw32\4.4.0\; >>"%CURRENT_DIR%\%1.log" 2>&1
17-
cd /D "%CURRENT_DIR%" >>"%CURRENT_DIR%\%1.log" 2>&1
14+
set CURRENT_DIR="%CD%"
15+
cd /D "%MINGW%\bin" >>%CURRENT_DIR%\%1.log 2>&1
16+
set PATH=%CD%;%CD%\..\libexec\gcc\mingw32\4.4.0\; >>%CURRENT_DIR%\%1.log 2>&1
17+
cd /D "%CURRENT_DIR%" >>%CURRENT_DIR%\%1.log 2>&1
1818
REM echo PATH = %PATH% >>%1.log 2>&1
1919
REM echo CD = %CD% >>%1.log 2>&1
2020
%MinGW%\bin\mingw32-make -f %1.makefile >>%1.log 2>&1
2121
set RESULT=%ERRORLEVEL%
2222
set PATH=%OLD_PATH%
2323
set OLD_PATH=
24-
exit %RESULT%
24+
exit %RESULT%

0 commit comments

Comments
 (0)