Skip to content

Commit db8da0d

Browse files
committed
OrcLib: LocationSet: cli overrides any previously set parsed location
1 parent 4fcc729 commit db8da0d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/OrcLib/LocationSet.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,27 @@ HRESULT LocationSet::AddLocationsFromArgcArgv(int argc, LPCWSTR argv[])
11011101
if (FAILED(hr = EnumerateLocations()))
11021102
return hr;
11031103

1104+
bool hasLocation = false;
1105+
for (int i = 1; i < argc; i++)
1106+
{
1107+
if (argv[i][0] != L'/' && argv[i][0] != L'+' && argv[i][0] != L'-')
1108+
{
1109+
hasLocation = true;
1110+
break;
1111+
}
1112+
}
1113+
1114+
if (!hasLocation)
1115+
{
1116+
return S_OK;
1117+
}
1118+
1119+
Log::Debug("Disable location set previously as a cli option overrides the value");
1120+
for (auto& location : m_Locations)
1121+
{
1122+
location.second->SetParse(false);
1123+
}
1124+
11041125
for (int i = 1; i < argc; i++)
11051126
{
11061127
if (argv[i][0] != L'/' && argv[i][0] != L'+' && argv[i][0] != L'-')

0 commit comments

Comments
 (0)