mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Revert string expansion of leading '.' and './' to the original behaviour.
* Now that the expansion of FOAM_CASE is delayed in the boundary conditions, the old expansion is simpler and seems to work better with IOobjects.
This commit is contained in:
@ -209,32 +209,16 @@ Foam::string& Foam::string::expand()
|
|||||||
*this = home(user)/file;
|
*this = home(user)/file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (operator[](0) == '.')
|
||||||
{
|
{
|
||||||
// expand a lone initial '.' and './' into CWD
|
// Expand initial '.' and './' into cwd
|
||||||
// otherwise strip leading './' sequences
|
if (size() == 1)
|
||||||
while
|
|
||||||
(
|
|
||||||
operator[](0) == '.'
|
|
||||||
&& (size() == 1 || operator[](1) == '/')
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// handle leading ".////" as well
|
|
||||||
size_type slashPos = 1;
|
|
||||||
while (size() > slashPos && operator[](slashPos) == '/')
|
|
||||||
{
|
|
||||||
++slashPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size() <= slashPos)
|
|
||||||
{
|
{
|
||||||
*this = cwd();
|
*this = cwd();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else
|
else if (operator[](1) == '/')
|
||||||
{
|
{
|
||||||
std::string::erase(0, slashPos);
|
std::string::replace(0, 1, cwd());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user