fix build plus warning if we have no readline

This commit is contained in:
Evgeniy Dushistov
2013-07-06 17:49:23 +00:00
parent 1386e5d160
commit 06e3f25ea4

View File

@@ -35,11 +35,22 @@
#include "readline.hpp"
#ifndef WITH_READLINE
static bool stdio_getline(FILE *in, std::string & str)
{
str.clear();
int ch;
while ((ch=fgetc(in))!=EOF && ch!='\n')
str+=ch;
if (EOF==ch)
return false;
return true;
}
class dummy_readline : public read_line {
public:
bool read(const string& banner, string& line) {
printf(banner.c_str());
printf("%s", banner.c_str());
return stdio_getline(stdin, line);
}
};