Using stdin instead of cin in the shell
Issue #93
resolved
cin seems to be thread unsafe and doesn't work very well on some computers.
Consider using stdin instead. Eg.
CRobotApp.cpp
char a[1024];
/** Might prevent a "command not found" print on some computers */
fscanf(stdin,"%*[^\n]%*c", a);
while(scl::CDatabase::getData()->running_)
{
while(scl::CDatabase::getData()->running_ &&
mode_char == false)
{
std::cout<<"\nscl>> ";
fgets(a, 1024, stdin);
a[strlen(a)-1] = '\0';
//Split the string into string tokens
std::istringstream iss(a);
Comments (2)
-
reporter -
reporter - changed status to resolved
Fixed in latest code.
- Log in to comment
On the same computer, ncurses seems to exit improperly. Doesn't return to the shell. However exit works.