mirror of https://gitlab.com/basile.b/dexed.git
fix possible AV when during detection of proj sources root
This commit is contained in:
parent
c4c35bb34a
commit
e9bc9d1776
|
@ -180,8 +180,20 @@ begin
|
||||||
if project.getFormat = pfDUB then
|
if project.getFormat = pfDUB then
|
||||||
begin
|
begin
|
||||||
pdb := TCEDubProject(project.getProject);
|
pdb := TCEDubProject(project.getProject);
|
||||||
if pdb.json.findArray('sourcePath', jsn) and (jsn.Count = 1) then
|
if pdb.json.findArray('sourcePath', jsn) then
|
||||||
|
begin
|
||||||
|
if (jsn.Count = 1) then
|
||||||
exit(project.filename.extractFilePath + jsn.Strings[0]);
|
exit(project.filename.extractFilePath + jsn.Strings[0]);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
result := project.filename.extractFilePath + 'src';
|
||||||
|
if result.dirExists then
|
||||||
|
exit;
|
||||||
|
result := project.filename.extractFilePath + 'source';
|
||||||
|
if result.dirExists then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
lst := TStringList.Create;
|
lst := TStringList.Create;
|
||||||
|
@ -199,9 +211,11 @@ begin
|
||||||
srcc.LoadFromFile(path);
|
srcc.LoadFromFile(path);
|
||||||
lex(srcc.Text, toks, @clbck.lexFindToken, [lxoNoComments]);
|
lex(srcc.Text, toks, @clbck.lexFindToken, [lxoNoComments]);
|
||||||
mnme := getModuleName(toks);
|
mnme := getModuleName(toks);
|
||||||
|
toks.Clear;
|
||||||
|
if mnme.isEmpty then
|
||||||
|
continue;
|
||||||
if path.extractFileName.stripFileExt = 'package' then
|
if path.extractFileName.stripFileExt = 'package' then
|
||||||
mnme := mnme + '.p';
|
mnme := mnme + '.p';
|
||||||
toks.Clear;
|
|
||||||
setLength(fldn, 0);
|
setLength(fldn, 0);
|
||||||
rng.init(mnme);
|
rng.init(mnme);
|
||||||
while true do
|
while true do
|
||||||
|
|
Loading…
Reference in New Issue