Command line editing give a wrong result for me on hush shell 1.9.1
Denys Vlasenko
vda.linux at googlemail.com
Sat Feb 16 14:10:14 UTC 2008
On Saturday 16 February 2008 01:28, Martinb_ARM_NOMMU_KISSDVD wrote:
> 2e test is:"typing abcd{backspace}e{enter}exit{enter}"
>
...
> read(0, "d", 1) = 1
> write(1, "d", 1) = 1
> read(0, "\177", 1) = 1
> write(1, " \276\377\217\275\336\337\177\320\363\237\345BL \276\377"..., 29)
> = 29
This is a very good test.
I want yo to do two things. First, add this asm():
if (cmdedit_x >= num) {
cmdedit_x -= num;
if (num <= 4) {
asm("# HERE");
printf("\b\b\b\b" + (4-num));
return;
}
printf("\033[%uD", num);
return;
}
run "make libbb/lineedit.s" and send me resulting lineedit.s.
Second. Change this line:
if (cmdedit_x >= num) {
cmdedit_x -= num;
- if (num <= 4) {
+ if (0) {
printf("\b\b\b\b" + (4-num));
return;
}
printf("\033[%uD", num);
return;
}
rebuild and check whether editing now works.
--
vda
More information about the busybox
mailing list