From 3327a1bf591319f0f739791ab5dd8509112d5d1d Mon Sep 17 00:00:00 2001 From: Joshy Date: Sun, 2 Jan 2011 23:03:07 +0000 Subject: [PATCH] Added a missing "Classes" unit in the uses clause. Added parsing of environment "MOZILLA_FIVE_HOME" under Windows. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1421 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/geckoport/nsXRE.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/geckoport/nsXRE.pas b/components/geckoport/nsXRE.pas index b862d2d9e..4e27c511a 100755 --- a/components/geckoport/nsXRE.pas +++ b/components/geckoport/nsXRE.pas @@ -3,7 +3,7 @@ unit nsXRE; interface uses - nsTypes, nsXPCOM, nsInit; + Classes, nsTypes, nsXPCOM, nsInit; type PXREAppData = ^nsXREAppData; @@ -171,6 +171,7 @@ var vers: TGREVersionRange; xpcomPath: array[0..MAX_PATH] of AnsiChar; lastSlash: PAnsiChar; + MOZILLAFIVEHOME: string; {$IFDEF LINUX} EachPath: string; LDPATH: string; @@ -199,8 +200,10 @@ begin Exit; *) //Changed checking order. Preference is xulrunner in application folder - if ParamStr(1)<>'' then begin - NS_StrLCopy(xpcomPath, PChar(ParamStr(1) + '\xpcom.dll'), MAX_PATH); + MOZILLAFIVEHOME:=GetEnvironmentVariable('MOZILLA_FIVE_HOME'); + if MOZILLAFIVEHOME<>'' then begin + if MOZILLAFIVEHOME[Length(MOZILLAFIVEHOME)]<>PathDelim then MOZILLAFIVEHOME:=MOZILLAFIVEHOME+PathDelim; + NS_StrLCopy(xpcomPath, PChar(MOZILLAFIVEHOME+'xpcom.dll'), MAX_PATH); Result:=NS_OK; end else begin NS_StrLCopy(xpcomPath, PChar(ExtractFilePath(ParamStr(0)) + 'xpcom.dll'), MAX_PATH);