diff --git a/ChangeLog.txt b/ChangeLog.txt index 5c59eec58..95ccf3b07 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1365,4 +1365,6 @@ do start at the same time (2015-07-24). * apps/examples/ostest: Add a test for the sporadic scheduler. This test is failing as of this commit (2015-07-24). - + * apps/system/readline: Add support for Unix-style tab complete toi + readline. This currently works only for built-in functions.i + Contributed by Nghia (2015-07-28). diff --git a/include/readline.h b/include/readline.h index ed62bf67d..1f0424341 100644 --- a/include/readline.h +++ b/include/readline.h @@ -87,7 +87,7 @@ extern "C" **************************************************************************/ #ifdef CONFIG_READLINE_TABCOMPLETION -void readline_prompt(FAR const *prompt); +void readline_prompt(FAR const char *prompt); #else # define readline_prompt(p) #endif diff --git a/nshlib/nsh_init.c b/nshlib/nsh_init.c index a9a799926..d60f308f9 100644 --- a/nshlib/nsh_init.c +++ b/nshlib/nsh_init.c @@ -40,6 +40,7 @@ #include #include +#include #include #include "nsh.h" diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c index a447745b5..6bf518b1c 100644 --- a/system/readline/readline_common.c +++ b/system/readline/readline_common.c @@ -63,7 +63,7 @@ static const char g_erasetoeol[] = VT100_CLEAREOL; #ifdef CONFIG_READLINE_TABCOMPLETION /* Prompt string to present at the beginning of the line */ -static const *char g_readline_prompt = NULL; +static FAR const char *g_readline_prompt = NULL; #endif /**************************************************************************** @@ -199,7 +199,7 @@ void tab_completion(FAR struct rl_common_s *vtbl, char *buf, int *nch) **************************************************************************/ #ifdef CONFIG_READLINE_TABCOMPLETION -void readline_prompt(FAR const *prompt) +void readline_prompt(FAR const char *prompt) { g_readline_prompt = prompt; }