Command line editing give a wrong result for me on hush shell 1.9.1

Denys Vlasenko vda.linux at googlemail.com
Mon Feb 18 09:51:25 UTC 2008


On Monday 18 February 2008 01:50, Martinb_ARM_NOMMU_KISSDVD wrote:
> this is "asdf{backspace}"
> 
> /hdd/newscript # ./hush
> /hdd/newscript # asdfhush:
>  bbbb=00 08 08 08 (0x15b4c7f)
>  hush:
>  bbbb=00 08 08 08 (0x15b4c7f)
> 
> this is "asdf{cursor left}"
> /hdd/newscript # asdfhush:
>  bbbb=00 08 08 08 (0x15b4c7f)
> 
> this is "asdf{home}"
> /hdd/newscript # asdfhush:
>  bbbb=2a 73 00 00 (0x15b4c7c)
> *s
> 
> (yes, the *s is also from console)
> 
> i also did compile with new toolchain (its the same but now i use)
> it has the same results

Here we see that correct pointer is given to printf now, sans my bug.
I had a bug there (forgot to advance bbbb 4 bytes forward first).

So, this should work. Can you try this:

        if (cmdedit_x >= num) {
                const char *bbbb = "\b\b\b\b";
                cmdedit_x -= num;
 bbbb += 4;
                if (num <= 4) {
                        bbbb -= num;
 asm volatile("# HERE");
 bb_error_msg("\n bbbb=%02x %02x %02x %02x (%p)", bbbb[0], bbbb[1], bbbb[2], bbbb[3], bbbb);
                        printf(bbbb);
                        return;
                }
                printf("\033[%uD", num);
                return;
        }

Show me results of "a{backspace}",  "ab{backspace}",  "abc{backspace}",
"abcd{backspace}" (separate runs of hush). You may also try removing
bb_error_msg() - it might work now.
--
vda



More information about the busybox mailing list