From: Jan B. <JBe...@no...> - 2004-03-31 13:18:48
|
I found this being not supported make the command history quite useless... --- /usr/local/src/lkcdutils-4.2-171/librl/rl.c 2002-07-15 11:15:05.000000000 +0200 +++ 4.2-171-core/librl/rl.c 2004-03-24 13:33:49.000000000 +0100 @@ -66,7 +66,7 @@ static int in; /* input tty handle */ static char *prompt=">"; /* prompt to be used */ static char *bol, *leftN, *rightN, *upN, *downN, *home; /* cursor movement */ -static char *kup, *kdown, *kleft, *kright, *kdel; /* keyboard input sequences */ +static const char *kup, *kdown, *kleft, *kright, *kdel, *kbksp; /* keyboard input sequences */ static char *cod; /* display management */ static char *bip; /* sound the bell */ static int notty=0; /* no controling terminal or missing basic kbd functionality */ @@ -74,10 +74,10 @@ static int xenl=0; static char *buf; static struct termio tio, stio; -static char *kwb="\033\177"; -static char *kwf="\033d"; -static char *fw="\033f"; -static char *bw="\033b"; +static const char *const kwb="\033\177"; +static const char *const kwf="\033d"; +static const char *const fw="\033f"; +static const char *const bw="\033b"; static rl_complete_func_t rl_complete_func; /* function for completing line */ /* @@ -137,7 +137,7 @@ kleft=tigetstr("kcub1"); kright=tigetstr("kcuf1"); kdel=tigetstr("kdch1"); - + kbksp=tigetstr("kbs"); } else { if(!ret) @@ -226,13 +226,13 @@ {LINEDONE, '\r'}, }; #define NBIND (sizeof(codes)/sizeof(codes[0])) -static int codes[]={ +static const int codes[]={ UP_HISTORY,DOWN_HISTORY,CURSOR_LEFT,CURSOR_RIGHT,DELETE, - KILLWORD,KILL_WORD_FORWARD,WORD_BACKWARD,WORD_FORWARD, + BACKSPACE,KILLWORD,KILL_WORD_FORWARD,WORD_BACKWARD,WORD_FORWARD, }; -static char **seqs[]={ +static const char *const *const seqs[]={ &kup,&kdown,&kleft,&kright,&kdel, - &kwb,&kwf,&bw,&fw + &kbksp,&kwb,&kwf,&bw,&fw }; #define buz() putp(bip) |