iphonelazext: fix pbx file reading to process escaped quote characters. Registered PBXShellScriptBuildPhase for reading

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4425 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2016-01-16 06:16:32 +00:00
parent 6b71585e4e
commit 76d93becf9
3 changed files with 25 additions and 4 deletions

View File

@@ -374,7 +374,7 @@ begin
tk:=p.FetchNextEntity;
refs:=TList.Create;
try
while tk<>etCloseObject do begin
while not (tk in [etError, etCloseObject]) do begin
if tk=etOpenObject then begin
id:=p.Name;
cmt:=p.LastComment;
@@ -388,8 +388,9 @@ begin
obj._id:=id;
PBXReadClass(p, obj, refs);
objs.Add(id, obj);
end else
end else begin
PBXParserSkipLevel(p);
end;
end else
PBXParserSkipLevel(p);
@@ -422,6 +423,7 @@ var
root : string;
objs : TObjHashList;
rt : TObject;
i : Integer;
begin
Result:=false;
AFileInfo.archiveVersion:='';
@@ -440,7 +442,7 @@ begin
tk:=p.FetchNextEntity;
while tk <> etEOF do begin
while not (tk in [etEOF,etError]) do begin
if tk = etValue then begin
if p.Name='archiveVersion' then AFileInfo.archiveVersion:=p.Value
else if p.Name='objectVersion' then AFileInfo.objectVersion:=p.Value
@@ -451,6 +453,13 @@ begin
tk:=p.FetchNextEntity;
end;
if tk=etError then begin
{for i:=0 to objs.Count-1 do
TObject(objs[i]).Free;}
Result:=false;
Exit;
end;
rt:=objs.Find(root);
if Assigned(rt) and (rt is PBXObject) then

View File

@@ -557,6 +557,8 @@ begin
end;
function TPBXScanner.DoFetchToken: TPBXToken;
var
donestr: Boolean;
begin
if idx>length(buf) then begin
Result:=tkEOF;
@@ -590,7 +592,16 @@ begin
'"': begin
inc(idx);
Result:=tkIdentifier;
FCurTokenString:=ScanTo(buf, idx, ['"']);
donestr:=false;
FCurTokenString:='';
repeat
FCurTokenString:=FCurTokenString+ScanTo(buf, idx, ['"']);
donestr:=(buf[idx-1]<>'\');
if not donestr then begin
FCurTokenString:=FCurTokenString+'"';
inc(idx);
end;
until donestr;
inc(idx);
end;
'=': begin

View File

@@ -709,6 +709,7 @@ initialization
PBXRegisterClass(PBXVariantGroup);
PBXRegisterClass(XCBuildConfiguration);
PBXRegisterClass(XCConfigurationList);
PBXRegisterClass(PBXShellScriptBuildPhase);
end.