[syslinux:elflink] ldlinux: Fix check for last command line entry

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Apr 17 11:24:13 PDT 2012


Commit-ID:  a51c83f273e7204d9ee8521e1f7e1d098e5d3382
Gitweb:     http://www.syslinux.org/commit/a51c83f273e7204d9ee8521e1f7e1d098e5d3382
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 2 Apr 2012 13:50:22 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 17 Apr 2012 10:58:33 +0100

ldlinux: Fix check for last command line entry

The expression that checks to see when we've reached the end of the
command line entries is incorrect, probably because the list macros
weren't used. Use list_is_last() to make the expression correct and
self-documenting.

This bug was highlighted by the following compiler warning,

cli.c: In function ‘cmd_reverse_search’:
cli.c:102:20: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/elflink/ldlinux/cli.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index fb041ae..6d74109 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;


More information about the Syslinux-commits mailing list