BUG: incorrect dictionary name for subOrEmptyDict (fixes #1442)

This commit is contained in:
Mark Olesen
2019-09-24 07:36:49 +02:00
committed by Andrew Heather
parent 5382ce775f
commit 603849383d
2 changed files with 10 additions and 6 deletions

View File

@ -131,7 +131,7 @@ Foam::dictionary::dictionary
parent_(parentDict) parent_(parentDict)
{ {
transfer(dict); transfer(dict);
name() = parentDict.name() + '.' + name(); name() = fileName::concat(parentDict.name(), name(), '.');
} }
@ -563,7 +563,8 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict
<< name() << endl; << name() << endl;
} }
return dictionary(*this, dictionary(name() + '.' + keyword)); // The move constructor properly qualifies the dictionary name
return dictionary(*this, dictionary(fileName(keyword)));
} }
@ -659,7 +660,8 @@ Foam::entry* Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
if (hashedEntries_.insert(entryPtr->keyword(), entryPtr)) if (hashedEntries_.insert(entryPtr->keyword(), entryPtr))
{ {
entryPtr->name() = name() + '.' + entryPtr->keyword(); entryPtr->name() =
fileName::concat(name(), entryPtr->keyword(), '.');
if (entryPtr->keyword().isPattern()) if (entryPtr->keyword().isPattern())
{ {
@ -684,7 +686,9 @@ Foam::entry* Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
if (hashedEntries_.insert(entryPtr->keyword(), entryPtr)) if (hashedEntries_.insert(entryPtr->keyword(), entryPtr))
{ {
entryPtr->name() = name() + '.' + entryPtr->keyword(); entryPtr->name() =
fileName::concat(name(), entryPtr->keyword(), '.');
parent_type::append(entryPtr); parent_type::append(entryPtr);
if (entryPtr->keyword().isPattern()) if (entryPtr->keyword().isPattern())

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation | Copyright (C) 2011-2017 OpenFOAM Foundation
@ -39,7 +39,7 @@ Foam::dictionary::dictionary
bool keepHeader bool keepHeader
) )
: :
name_(parentDict.name() + '.' + name), name_(fileName::concat(parentDict.name(), name, '.')),
parent_(parentDict) parent_(parentDict)
{ {
read(is, keepHeader); read(is, keepHeader);