Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
6261ef05
Commit
6261ef05
authored
Oct 25, 2010
by
mattijs
Browse files
ENH: setSet : proper exit upon eof
parent
df4dc659
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/manipulation/setSet/setSet.C
View file @
6261ef05
...
...
@@ -934,18 +934,31 @@ int main(int argc, char *argv[])
{
char
*
linePtr
=
readline
(
"readline>"
);
rawLine
=
string
(
linePtr
);
if
(
linePtr
)
{
rawLine
=
string
(
linePtr
);
if
(
*
linePtr
)
{
add_history
(
linePtr
);
write_history
(
historyFile
);
}
if
(
*
linePtr
)
free
(
linePtr
);
// readline uses malloc, not new.
}
else
{
add_history
(
linePtr
);
write_history
(
historyFile
);
break
;
}
free
(
linePtr
);
// readline uses malloc, not new.
}
# else
{
if
(
!
std
::
cin
.
good
())
{
Info
<<
"End of cin"
<<
endl
;
// No error.
break
;
}
Info
<<
"Command>"
<<
flush
;
std
::
getline
(
std
::
cin
,
rawLine
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment