Displaying 5 results from an estimated 5 matches for "last_found".
2011 Mar 16
0
[GIT PULL] elflink changes
...--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -68,6 +68,65 @@ int mygetkey(clock_t timeout)
}
}
+static const char * cmd_reverse_search(int *cursor)
+{
+ int key;
+ int i = 0;
+ char buf[MAX_CMDLINE_LEN];
+ const char *p = NULL;
+ struct cli_command *last_found;
+ struct cli_command *last_good = NULL;
+
+ last_found = list_entry(cli_history_head.next, typeof(*last_found), list);
+
+ memset(buf, 0, MAX_CMDLINE_LEN);
+
+ printf("\033[1G\033[1;36m(reverse-i-search)`': \033[0m");
+ while (1) {
+ key = mygetkey(0);
+
+ if (k...
2010 Oct 03
3
[PATCH 0/3] elflink: Another small fixes on CLI
Hi,
This is a another small set of fixes about CLI on elflink branch.
Liu Aleaxander (3):
elflink: use 'input' as the prompt of the CLI
elflink: Add ctrl-R key bind support
elflink: handle the NULL return of edit_cmdline
core/elflink/cli.c | 88 +++++++++++++++++++++++++++++++++++++++++---
core/elflink/load_env32.c | 4 ++-
2 files changed, 85 insertions(+), 7
2013 Sep 16
0
[PATCH 1/2] com32: Fix bugs on cmd_reverse_search (Triple fault dimension)
...--git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 7c4f14c..b70224a 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -89,10 +89,14 @@ static const char * cmd_reverse_search(int *cursor, clock_t *kbd_to,
break;
}
- while (!list_is_last(&last_found->list, &cli_history_head)) {
+ while (last_found) {
p = strstr(last_found->command, buf);
if (p)
break;
+
+ if (list_is_last(&last_found->list, &cli_history_head))
+ break;
+
last_found = list_entry(last_found->list.next, typeof(*la...
2013 Sep 17
1
[PATCH 3/4 v2] com32: Fix bugs on cmd_reverse_search (Triple fault dimension)
...--git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 7c4f14c..a50124c 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -89,10 +89,14 @@ static const char * cmd_reverse_search(int *cursor, clock_t *kbd_to,
break;
}
- while (!list_is_last(&last_found->list, &cli_history_head)) {
+ while (last_found) {
p = strstr(last_found->command, buf);
if (p)
break;
+
+ if (list_is_last(&last_found->list, &cli_history_head))
+ break;
+
last_found = list_entry(last_found->list.next, typeof(*last_found),...
2012 Apr 17
2
[GIT PULL] elflink warning fixes and auto extension support
...{
static com32sys_t reg;
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index fb041ae..498644e 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -99,7 +99,7 @@ static const char * cmd_reverse_search(int *cursor)
break;
}
- while (last_found != &cli_history_head) {
+ while (!list_is_last(&last_found->list, &cli_history_head)) {
p = strstr(last_found->command, buf);
if (p)
break;
@@ -139,7 +139,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
bool done = false;...