From 7889df78a930eb7bb30bd0e2270ca38cf93a8d1f Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@Germany> Date: Tue, 1 Dec 2009 13:50:51 +0100 Subject: [PATCH] fixup #remove functionEntry and revert 09b3c166dee9098 - forgot to use readList in removeEntry, which caused the test failure. - remaining problem: it doesn't work as might be expected This is the problem: dict { foo xxx; bar yyy; } dict { baz zzz; #remove foo } This only removes 'foo' from the current scope (the second dict), since it occurs before the dictionary merge does. To remove from the final, merged dictionary, we'd need a new deleteEntry type that would do the right thing on the merge before self-destructing (ie, removing itself too). --- applications/test/dictionary/testDict | 6 +++--- .../db/dictionary/functionEntries/removeEntry/removeEntry.C | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/applications/test/dictionary/testDict b/applications/test/dictionary/testDict index 08c325bd4c7..42a473a52b2 100644 --- a/applications/test/dictionary/testDict +++ b/applications/test/dictionary/testDict @@ -71,7 +71,7 @@ boundaryField } // this should have no effect - //#remove $inactive + #remove inactive inlet_7 { $active } #inputMode overwrite @@ -105,9 +105,9 @@ baz // this should work -//#remove active +#remove active // this should work too -//#remove ( bar baz ) +#remove ( bar baz ) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C index 34154cce481..78facd8e231 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C @@ -65,8 +65,8 @@ bool Foam::functionEntries::removeEntry::execute Istream& is ) { - wordList dictKeys = parentDict.toc(); - wordReList patterns(is); + wordList dictKeys = parentDict.toc(); + wordReList patterns = readList<wordRe>(is); labelList indices = findStrings(patterns, dictKeys); -- GitLab