Skip to content

Commit

Permalink
Set current directory for license file when parsing encrypted library (
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 1, 2021
1 parent 1c2a5c5 commit 1b2dd96
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions OMCompiler/Compiler/Script/CevalScript.mo
Expand Up @@ -1262,16 +1262,22 @@ algorithm

case ("parseEncryptedPackage",Values.STRING(filename)::Values.STRING(workdir)::_)
algorithm
vals := {};
(b, filename) := unZipEncryptedPackageAndCheckFile(workdir, filename, false);
if b then
// clear the errors before!
Error.clearMessages() "Clear messages";
Print.clearErrorBuf() "Clear error buffer";
filename := Testsuite.friendlyPath(filename);
(paths) := Interactive.parseFile(filename, "UTF-8");
vals := List.map(paths,ValuesUtil.makeCodeTypeName);
end if;
str := System.pwd();
try
0 := System.cd(System.dirname(filename));
vals := {};
(b, filename) := unZipEncryptedPackageAndCheckFile(workdir, filename, false);
if b then
// clear the errors before!
Error.clearMessages() "Clear messages";
Print.clearErrorBuf() "Clear error buffer";
filename := Testsuite.friendlyPath(filename);
(paths) := Interactive.parseFile(filename, "UTF-8");
vals := List.map(paths,ValuesUtil.makeCodeTypeName);
end if;
else
end try;
0 := System.cd(str);
then
ValuesUtil.makeArray(vals);

Expand All @@ -1290,10 +1296,9 @@ algorithm
SymbolTable.setAbsyn(newp);
end if;
outCache := FCore.emptyCache();
0 := System.cd(str);
else
0 := System.cd(str);
end try;
0 := System.cd(str);
then
Values.BOOL(b);

Expand Down

0 comments on commit 1b2dd96

Please sign in to comment.