From 97fc64260a59293ab42df2642e75273713a7b82e Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Tue, 19 Dec 2017 17:59:15 +0100
Subject: [PATCH] BUG: still require IStringStream for argList (closes #672)

- regression introduced by part of commit e77edcf9a068.

  Specifically the way that scalarRanges is written, it parses through
  until it hits invalid input. This works fine with an IStringStream,
  but the ITstream is pickier and reports this as being an error.

  So revert to IStringStream and be less picky about argList parsing.
  in the longer-term, should fix scalarRanges instead.
---
 src/OpenFOAM/global/argList/argList.H  | 6 +++---
 src/OpenFOAM/global/argList/argListI.H | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H
index 0e1d3631a5..ef4951fc72 100644
--- a/src/OpenFOAM/global/argList/argList.H
+++ b/src/OpenFOAM/global/argList/argList.H
@@ -102,7 +102,7 @@ SourceFiles
 #include "fileName.H"
 #include "parRun.H"
 #include "OSspecific.H"
-#include "ITstream.H"
+#include "StringStream.H"
 #include <utility>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -308,8 +308,8 @@ public:
             //- Return how many of the specified options were used
             label optionCount(std::initializer_list<word> optionNames) const;
 
-            //- Return an input token stream for the named option
-            inline ITstream optionLookup(const word& optionName) const;
+            //- Return an input stream for the named option
+            inline IStringStream optionLookup(const word& optionName) const;
 
             //- Read a value from the named option
             template<class T>
diff --git a/src/OpenFOAM/global/argList/argListI.H b/src/OpenFOAM/global/argList/argListI.H
index d3c733222f..30abffdf47 100644
--- a/src/OpenFOAM/global/argList/argListI.H
+++ b/src/OpenFOAM/global/argList/argListI.H
@@ -105,12 +105,12 @@ inline bool Foam::argList::optionFound(const word& optionName) const
 }
 
 
-inline Foam::ITstream Foam::argList::optionLookup
+inline Foam::IStringStream Foam::argList::optionLookup
 (
     const word& optionName
 ) const
 {
-    return ITstream(optionName, options_[optionName]);
+    return IStringStream(options_[optionName]);
 }
 
 
-- 
GitLab