commit 6beff8a2df63745c1902d2551b8233e603ca317b from: Marcel Rodrigues date: Sat Nov 08 13:04:09 2014 UTC Better line editing. commit - d43ebc7845ab829afbfebf96cecf9c86b663d704 commit + 6beff8a2df63745c1902d2551b8233e603ca317b blob - 307f1cb33fd8c0893098e1c188b586f49a18004a blob + 8da95c460b0cb0f5ca1ea8fb6c015e029a5fb445 --- rover.c +++ rover.c @@ -1,6 +1,7 @@ #include -#include #include +#include +#include #include /* ? */ #include /* FILENAME_MAX */ #include /* setlocale(), LC_ALL */ @@ -373,10 +374,11 @@ main() else if (ch == killc) { length = 0; SEARCH[0] = '\0'; + SEARCH[1] = '\0'; rover.fsel = oldsel; rover.scroll = oldscroll; } - else if (length < SEARCHSZ - 2) { + else if (length < SEARCHSZ - 2 && isprint(ch)) { SEARCH[length++] = ch; SEARCH[length+1] = '\0'; }