aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux/cli.c
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2011-03-15 20:44:53 +0000
committerMatt Fleming <matt.fleming@linux.intel.com>2011-03-15 21:15:12 +0000
commit9a92abb6f4fe08a8649afd68ab6004417f6961e4 (patch)
tree009da83f06c364d36a6d80e9c141623c3142c7ec /com32/elflink/ldlinux/cli.c
parent125fe2b406ef56c472947be5b731fa9adaf303da (diff)
downloadsyslinux-9a92abb6f4fe08a8649afd68ab6004417f6961e4.tar.gz
syslinux-9a92abb6f4fe08a8649afd68ab6004417f6961e4.tar.xz
syslinux-9a92abb6f4fe08a8649afd68ab6004417f6961e4.zip
elflink: use 'input' as the prompt of the CLI
Use the paramter 'input' of fucntion edit_cmdline as the prompt of the CLI. I guess this is what the 'input' parameter used for. It's is more extendable than using a specify prompt. And, for now, let's use the 'syslinux' as the prompt.:) Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
Diffstat (limited to 'com32/elflink/ldlinux/cli.c')
-rw-r--r--com32/elflink/ldlinux/cli.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 130dc6de..b482760c 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -93,7 +93,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
strncpy(cmdline, input, MAX_CMDLINE_LEN);
cmdline[MAX_CMDLINE_LEN - 1] = '\0';
- len = cursor = strlen(cmdline);
+ len = cursor = 0;//strlen(cmdline);
prev_len = 0;
x = y = 0;
@@ -118,9 +118,9 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
printf("\033[?7l\033[?25l");
if (y)
printf("\033[%dA", y);
- printf("\033[1G\033[1;36m> \033[0m");
+ printf("\033[1G\033[1;36m%s \033[0m", input);
- x = 2;
+ x = strlen(input);
y = 0;
at = 0;
while (at < prev_len) {
@@ -135,8 +135,8 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
}
printf("\033[K\r");
- dy = y - (cursor + 2) / width;
- x = (cursor + 2) % width;
+ dy = y - (cursor + strlen(input) + 1) / width;
+ x = (cursor + strlen(input) + 1) % width;
if (dy) {
printf("\033[%dA", dy);