Small improvement in handling of the input

This commit is contained in:
Baptiste Wicht 2014-04-02 18:24:07 +02:00
parent 2df7dac536
commit e0c17d79a1

View File

@ -119,13 +119,13 @@ void pwd_command(const std::vector<std::string>&){
int main(){ int main(){
get_console_information(); get_console_information();
char input_buffer[64]; char input_buffer[128];
std::string current_input; std::string current_input;
print("thor> ");
while(true){ while(true){
print("thor> "); auto c = read_input(input_buffer, 127);
auto c = read_input(input_buffer, 63);
if(input_buffer[c-1] == '\n'){ if(input_buffer[c-1] == '\n'){
if(c > 1){ if(c > 1){
@ -174,6 +174,8 @@ int main(){
} }
current_input.clear(); current_input.clear();
print("thor> ");
} else { } else {
input_buffer[c] = '\0'; input_buffer[c] = '\0';