diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-05-15 03:27:53 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-05-15 03:27:53 +0200 |
commit | c15f40c3e7bfeae1b616c53a574308c2df707b3d (patch) | |
tree | 402bed67555916e3ff3c6a08ccc6e994372d4524 /include | |
parent | 1b0a93edb93a93c30d7fbb35571f109ddf8a67a2 (diff) | |
download | busybox-w32-c15f40c3e7bfeae1b616c53a574308c2df707b3d.tar.gz busybox-w32-c15f40c3e7bfeae1b616c53a574308c2df707b3d.tar.bz2 busybox-w32-c15f40c3e7bfeae1b616c53a574308c2df707b3d.zip |
lineedit: use read_key to recognize ESC sequence.
This fixes several vi mode bugs and prepares for further fixes.
function old new delta
read_line_input 3287 5511 +2224
remember_in_history - 499 +499
lineedit_read_key - 70 +70
read_key 321 332 +11
input_tab 2823 - -2823
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 2/0 up/down: 2804/-2823) Total: -19 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/libbb.h b/include/libbb.h index 3a94a0070..128aa9207 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1198,23 +1198,23 @@ unsigned long long bb_makedev(unsigned int major, unsigned int minor) FAST_FUNC; | |||
1198 | 1198 | ||
1199 | #if ENABLE_FEATURE_EDITING | 1199 | #if ENABLE_FEATURE_EDITING |
1200 | /* It's NOT just ENABLEd or disabled. It's a number: */ | 1200 | /* It's NOT just ENABLEd or disabled. It's a number: */ |
1201 | #ifdef CONFIG_FEATURE_EDITING_HISTORY | 1201 | # ifdef CONFIG_FEATURE_EDITING_HISTORY |
1202 | # define MAX_HISTORY (CONFIG_FEATURE_EDITING_HISTORY + 0) | 1202 | # define MAX_HISTORY (CONFIG_FEATURE_EDITING_HISTORY + 0) |
1203 | #else | 1203 | # else |
1204 | # define MAX_HISTORY 0 | 1204 | # define MAX_HISTORY 0 |
1205 | #endif | 1205 | # endif |
1206 | typedef struct line_input_t { | 1206 | typedef struct line_input_t { |
1207 | int flags; | 1207 | int flags; |
1208 | const char *path_lookup; | 1208 | const char *path_lookup; |
1209 | #if MAX_HISTORY | 1209 | # if MAX_HISTORY |
1210 | int cnt_history; | 1210 | int cnt_history; |
1211 | int cur_history; | 1211 | int cur_history; |
1212 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY | 1212 | # if ENABLE_FEATURE_EDITING_SAVEHISTORY |
1213 | unsigned cnt_history_in_file; | 1213 | unsigned cnt_history_in_file; |
1214 | const char *hist_file; | 1214 | const char *hist_file; |
1215 | #endif | 1215 | # endif |
1216 | char *history[MAX_HISTORY + 1]; | 1216 | char *history[MAX_HISTORY + 1]; |
1217 | #endif | 1217 | # endif |
1218 | } line_input_t; | 1218 | } line_input_t; |
1219 | enum { | 1219 | enum { |
1220 | DO_HISTORY = 1 * (MAX_HISTORY > 0), | 1220 | DO_HISTORY = 1 * (MAX_HISTORY > 0), |
@@ -1241,12 +1241,12 @@ int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC; | |||
1241 | 1241 | ||
1242 | 1242 | ||
1243 | #ifndef COMM_LEN | 1243 | #ifndef COMM_LEN |
1244 | #ifdef TASK_COMM_LEN | 1244 | # ifdef TASK_COMM_LEN |
1245 | enum { COMM_LEN = TASK_COMM_LEN }; | 1245 | enum { COMM_LEN = TASK_COMM_LEN }; |
1246 | #else | 1246 | # else |
1247 | /* synchronize with sizeof(task_struct.comm) in /usr/include/linux/sched.h */ | 1247 | /* synchronize with sizeof(task_struct.comm) in /usr/include/linux/sched.h */ |
1248 | enum { COMM_LEN = 16 }; | 1248 | enum { COMM_LEN = 16 }; |
1249 | #endif | 1249 | # endif |
1250 | #endif | 1250 | #endif |
1251 | typedef struct procps_status_t { | 1251 | typedef struct procps_status_t { |
1252 | DIR *dir; | 1252 | DIR *dir; |