mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: setSet : proper exit upon eof
This commit is contained in:
@ -934,6 +934,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
char* linePtr = readline("readline>");
|
char* linePtr = readline("readline>");
|
||||||
|
|
||||||
|
if (linePtr)
|
||||||
|
{
|
||||||
rawLine = string(linePtr);
|
rawLine = string(linePtr);
|
||||||
|
|
||||||
if (*linePtr)
|
if (*linePtr)
|
||||||
@ -944,8 +946,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
free(linePtr); // readline uses malloc, not new.
|
free(linePtr); // readline uses malloc, not new.
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
# else
|
# else
|
||||||
{
|
{
|
||||||
|
if (!std::cin.good())
|
||||||
|
{
|
||||||
|
Info<< "End of cin" << endl;
|
||||||
|
// No error.
|
||||||
|
break;
|
||||||
|
}
|
||||||
Info<< "Command>" << flush;
|
Info<< "Command>" << flush;
|
||||||
std::getline(std::cin, rawLine);
|
std::getline(std::cin, rawLine);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user