Sascha Hauer
d3f4aa52ca
readline: Fix history prev when history is empty
...
We cannot use list_entry() on an empty list. Without history
we have to return an empty line. This fixes a crash when the
cursor up button is pressed and no command has been entered
previously. Broken since:
commit ada160a34a
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date: Tue Jul 29 11:54:26 2014 +0200
readline: reimplement history functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Teresa Gamez <t.gamez@phytec.de>
2014-09-01 14:24:50 +02:00
Sascha Hauer
ada160a34a
readline: reimplement history functions
...
This reimplements the history functions in readline.
- Use regular lists instead of homegrown list implementation
- Allocate history strings dynamically instead of copying strings
to fixed buffers without checking the size
- saves us an initcall
- slightly smaller
- no longer add duplicates to the history
- when moving past the last history entry print an empty line
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 13:51:00 +02:00
Sascha Hauer
7e66707c76
input: Add BB_ prefix to KEY_ defines
...
Our KEY_ defines conflict with the standard Linux KEY_ defines, so
add a BB_ prefix to them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:23:37 +01:00
Sascha Hauer
6058a2273c
readline: remove unused variable
...
'rc' is never set to anything else than 0, so drop it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-12 14:45:03 +01:00
Antony Pavlov
ff6b691a8c
readline: fix the 'new blank line at EOF' typo
...
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-29 10:02:06 +01:00
Antony Pavlov
ad439b75a2
readline: add ctrl-w handling (cut-the-last-word)
...
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-29 10:02:06 +01:00
Antony Pavlov
db494137a8
readline: move backspace key handling to the DO_BACKSPACE macro
...
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-29 10:02:06 +01:00
Antony Pavlov
d93a20734d
lib/readline.c: fix unused-but-set-variable gcc warning
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-04 08:59:39 +02:00
Krzysztof Halasa
1b6a3e3634
Silence few warnings.
...
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 09:02:40 +01:00
Sascha Hauer
eff51304a7
readline: sparse fixes
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:22 +02:00
Sascha Hauer
73108301d4
Remove unnecessary casts in key defines
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-18 16:44:54 +01:00
Sascha Hauer
82875bfd52
readline: Allow only ascii and printable characters
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-29 08:50:42 +02:00
Sascha Hauer
2209ae02ba
readline: Fix wrong screen reprinting. Try:
...
abcde<BACKSPACE><HOME><DEL>
2008-03-02 17:24:05 +01:00
Sascha Hauer
23d1cead89
readline: Fix a bug when tab completion is used in the middle
...
of the line.
2008-03-02 17:23:10 +01:00
Sascha Hauer
df31bb46be
implement TAB completion
2008-03-01 21:08:14 +01:00
sascha
10bdc84297
implement delete key in readline
2007-10-16 23:08:37 +02:00
Sascha Hauer
b3dc734018
declare lots of functions static
2007-09-28 10:07:26 +02:00
Sascha Hauer
0dd68e795e
- putc is now putchar for better standard conformity
...
- make printf return int
2007-09-21 09:09:06 +02:00
Sascha Hauer
4b07af6730
svn_rev_643
...
structure cleanup
2007-07-05 18:02:13 +02:00