From 46c642297629fe75b5ba6b082fd4bec3e3480ef5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 1 Jul 2008 18:17:07 +0100 Subject: [PATCH] corrected logic --- .../mesh/manipulation/setSet/setSet.C | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 488d22aa2a..2d70f797c7 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -344,7 +344,7 @@ bool doCommand / (10*Pstream::nProcs()); - bool error = false; + bool ok = true; // Set to work on autoPtr currentSetPtr(NULL); @@ -388,7 +388,7 @@ bool doCommand Pout<< " Cannot construct/load set " << topoSet::localPath(mesh, setName) << endl; - error = true; + ok = false; } else { @@ -518,7 +518,7 @@ bool doCommand } catch (Foam::IOerror& fIOErr) { - error = true; + ok = false; Pout<< fIOErr.message().c_str() << endl; @@ -529,7 +529,7 @@ bool doCommand } catch (Foam::error& fErr) { - error = true; + ok = false; Pout<< fErr.message().c_str() << endl; @@ -539,15 +539,16 @@ bool doCommand } } - return !error; + return ok; } +// Status returned from parsing the first token of the line enum commandStatus { - QUIT, - INVALID, - VALID + QUIT, // quit program + INVALID, // token is not a valid set manipulation command + VALID // ,, is a valid ,, }; @@ -841,7 +842,7 @@ int main(int argc, char *argv[]) } } - ok = false; + ok = true; if (stat == QUIT) {