From 5598f9414bc7fe6f27b81ccdc142aca487dac8fc Mon Sep 17 00:00:00 2001 From: skalogryz Date: Wed, 23 Mar 2016 13:17:53 +0000 Subject: [PATCH] iphonelazext: fix info.plist detection of xml format git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4585 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/iphonelazext/plistfile.pas | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/iphonelazext/plistfile.pas b/components/iphonelazext/plistfile.pas index 4deef74da..b3a96c802 100644 --- a/components/iphonelazext/plistfile.pas +++ b/components/iphonelazext/plistfile.pas @@ -142,21 +142,25 @@ function LoadFromFile(const fn: string; plist: TPListFile): Boolean; var st : TFileStream; buf : string[5]; + res : integer; + {$ifdef darwin} xs : string; err : LongWord; m : TStringStream; doc : TXMLDocument; + {$endif} begin //todo: detect plist type and convert is necessary st:=TFileSTream.Create(fn, fmOpenRead or fmShareDenyNone); try - st.Read(buf, 5); + SetLength(buf, 5); + res:=st.Read(buf[1], 5); finally st.Free; end; - if buf='=count) then Exit; items[idx].Free;