summaryrefslogtreecommitdiff
path: root/compiler/options.pas
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-05-06 21:16:51 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-05-06 21:16:51 +0000
commitc4cfb489bd971b2f01ec360717a6ad4470679237 (patch)
tree43e36644b190d23b48115df99938227dfa913a04 /compiler/options.pas
parent6c737079b073fa9ed42a7b61a0db89011bf4892d (diff)
downloadfpc-c4cfb489bd971b2f01ec360717a6ad4470679237.tar.gz
* also allow a ";"-separated list of namespaces for -FN
+ added test git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@38939 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/options.pas')
-rw-r--r--compiler/options.pas28
1 files changed, 26 insertions, 2 deletions
diff --git a/compiler/options.pas b/compiler/options.pas
index 34a9ea1b77..5c1e2a0fff 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -3629,7 +3629,10 @@ var
i : tfeature;
j : longint;
abi : tabi;
- cmditem: TCmdStrListItem;
+ tmplist : TCmdStrList;
+ cmditem,
+ tmpcmditem : TCmdStrListItem;
+ cmdstr : TCmdStr;
{$if defined(cpucapabilities)}
cpuflag : tcpuflags;
hs : string;
@@ -3838,12 +3841,33 @@ begin
add_package(option.parapackages.NameOfIndex(j),true,true);
{ add default namespaces }
+ tmplist:=TCmdStrList.Create;
cmditem:=TCmdStrListItem(option.paranamespaces.First);
while assigned(cmditem) do
begin
- namespacelist.insert(cmditem.Str);
+ { use a temporary list cause if ";" are involved we need to reverse the
+ order due to how TCmdStrList behaves }
+ cmdstr:=cmditem.str;
+ repeat
+ j:=Pos(';',cmdstr);
+ if j>0 then
+ begin
+ tmplist.insert(copy(cmdstr,1,j-1));
+ delete(cmdstr,1,j);
+ end
+ else
+ tmplist.insert(cmdstr);
+ until j=0;
+ tmpcmditem:=TCmdStrListItem(tmplist.First);
+ while assigned(tmpcmditem) do
+ begin
+ namespacelist.insert(tmpcmditem.Str);
+ tmpcmditem:=TCmdStrListItem(tmpcmditem.Next);
+ end;
+ tmplist.clear;
cmditem:=TCmdStrListItem(cmditem.Next);
end;
+ tmplist.Free;
{ add unit environment and exepath to the unit search path }
if inputfilepath<>'' then