do not implement get_user_input() in DISABLE_NCURSES builds Signed-off-by: Sergey Senozhatsky --- src/lib.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib.cpp b/src/lib.cpp index 77e49a2..ddb0b5c 100644 --- a/src/lib.cpp +++ b/src/lib.cpp @@ -436,12 +436,16 @@ void process_directory(const char *d_name, callback fn) int get_user_input(char *buf, unsigned sz) { + int ret = 0; +#ifndef DISABLE_NCURSES fflush(stdout); echo(); /* Upon successful completion, these functions return OK. Otherwise, they return ERR. */ - int ret = getnstr(buf, sz); + ret = getnstr(buf, sz); noecho(); fflush(stdout); /* to distinguish between getnstr error and empty line */ - return ret || strlen(buf); + ret |= strlen(buf); +#endif + return ret; }