lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / libbb / read_key.c
index 8422976c91b908392f896ae6d7447d084da7f233..840325c99e99edaa6fc8bf9268269b48f04241f3 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (C) 2008 Rob Landley <rob@landley.net>
  * Copyright (C) 2008 Denys Vlasenko <vda.linux@googlemail.com>
  *
- * Licensed under GPL version 2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 #include "libbb.h"
 
@@ -214,7 +214,7 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
                }
                n++;
                /* Try to decipher "ESC [ NNN ; NNN R" sequence */
-               if (ENABLE_FEATURE_EDITING_ASK_TERMINAL
+               if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL || ENABLE_FEATURE_VI_ASK_TERMINAL)
                 && n >= 5
                 && buffer[0] == '['
                 && buffer[n-1] == 'R'