mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: windows IOobject::path() incorrect from absolute (fixes #1738)
- only checked if it started with '/' and not 'd:/' (for example).
This commit is contained in:
@ -40,7 +40,7 @@ namespace Foam
|
|||||||
char Foam::IOobject::scopeSeparator
|
char Foam::IOobject::scopeSeparator
|
||||||
(
|
(
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Windows: using ':' for scoping conflicts with d:/path etc
|
// Windows: using ':' causes scoping conflicts with d:/path etc
|
||||||
Foam::debug::infoSwitch("scopeSeparator", '_')
|
Foam::debug::infoSwitch("scopeSeparator", '_')
|
||||||
#else
|
#else
|
||||||
Foam::debug::infoSwitch("scopeSeparator", ':')
|
Foam::debug::infoSwitch("scopeSeparator", ':')
|
||||||
@ -467,10 +467,19 @@ const Foam::fileName& Foam::IOobject::caseName() const
|
|||||||
Foam::fileName Foam::IOobject::path() const
|
Foam::fileName Foam::IOobject::path() const
|
||||||
{
|
{
|
||||||
// A file is 'outside' of the case if it has been specified using an
|
// A file is 'outside' of the case if it has been specified using an
|
||||||
// absolute path (starts with '/')
|
// absolute path
|
||||||
|
|
||||||
if (instance().starts_with('/'))
|
const auto first = instance().find('/');
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
first == 0
|
||||||
|
#ifdef _WIN32
|
||||||
|
|| (first == 2 && instance()[1] == ':') // Eg, d:/path
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
|
// Absolute path (starts with '/' or 'd:/')
|
||||||
return instance();
|
return instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user