Commit 3aa55997 authored by unknown's avatar unknown

fixed bug with locales in libedit


configure.in:
  fixed bug with external libedit
parent 9a4258b4
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
#include <signal.h> #include <signal.h>
#include <violite.h> #include <violite.h>
#if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H)
#include <locale.h>
#endif
const char *VER= "13.5"; const char *VER= "13.5";
/* Don't try to make a nice table if the data is too big */ /* Don't try to make a nice table if the data is too big */
...@@ -1111,6 +1115,9 @@ static void initialize_readline (char *name) ...@@ -1111,6 +1115,9 @@ static void initialize_readline (char *name)
rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion; rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion;
rl_completion_entry_function= (rl_compentry_func_t*)&no_completion; rl_completion_entry_function= (rl_compentry_func_t*)&no_completion;
#elif defined(USE_LIBEDIT_INTERFACE) #elif defined(USE_LIBEDIT_INTERFACE)
#ifdef HAVE_LOCALE_H
setlocale(LC_ALL,""); /* so as libedit use isprint */
#endif
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion; rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
rl_completion_entry_function= (CPFunction*)&no_completion; rl_completion_entry_function= (CPFunction*)&no_completion;
#else #else
......
...@@ -184,135 +184,135 @@ private const el_action_t el_map_emacs[] = { ...@@ -184,135 +184,135 @@ private const el_action_t el_map_emacs[] = {
/* 124 */ ED_INSERT, /* | */ /* 124 */ ED_INSERT, /* | */
/* 125 */ ED_INSERT, /* } */ /* 125 */ ED_INSERT, /* } */
/* 126 */ ED_INSERT, /* ~ */ /* 126 */ ED_INSERT, /* ~ */
/* 127 */ ED_INSERT, /* ^? */ /* 127 */ ED_DELETE_PREV_CHAR, /* ^? */
/* 128 */ ED_INSERT, /* M-^@ */ /* 128 */ ED_UNASSIGNED, /* M-^@ */
/* 129 */ ED_INSERT, /* M-^A */ /* 129 */ ED_UNASSIGNED, /* M-^A */
/* 130 */ ED_INSERT, /* M-^B */ /* 130 */ ED_UNASSIGNED, /* M-^B */
/* 131 */ ED_INSERT, /* M-^C */ /* 131 */ ED_UNASSIGNED, /* M-^C */
/* 132 */ ED_INSERT, /* M-^D */ /* 132 */ ED_UNASSIGNED, /* M-^D */
/* 133 */ ED_INSERT, /* M-^E */ /* 133 */ ED_UNASSIGNED, /* M-^E */
/* 134 */ ED_INSERT, /* M-^F */ /* 134 */ ED_UNASSIGNED, /* M-^F */
/* 135 */ ED_INSERT, /* M-^G */ /* 135 */ ED_UNASSIGNED, /* M-^G */
/* 136 */ ED_INSERT, /* M-^H */ /* 136 */ ED_DELETE_PREV_WORD, /* M-^H */
/* 137 */ ED_INSERT, /* M-^I */ /* 137 */ ED_UNASSIGNED, /* M-^I */
/* 138 */ ED_INSERT, /* M-^J */ /* 138 */ ED_UNASSIGNED, /* M-^J */
/* 139 */ ED_INSERT, /* M-^K */ /* 139 */ ED_UNASSIGNED, /* M-^K */
/* 140 */ ED_INSERT, /* M-^L */ /* 140 */ ED_CLEAR_SCREEN, /* M-^L */
/* 141 */ ED_INSERT, /* M-^M */ /* 141 */ ED_UNASSIGNED, /* M-^M */
/* 142 */ ED_INSERT, /* M-^N */ /* 142 */ ED_UNASSIGNED, /* M-^N */
/* 143 */ ED_INSERT, /* M-^O */ /* 143 */ ED_UNASSIGNED, /* M-^O */
/* 144 */ ED_INSERT, /* M-^P */ /* 144 */ ED_UNASSIGNED, /* M-^P */
/* 145 */ ED_INSERT, /* M-^Q */ /* 145 */ ED_UNASSIGNED, /* M-^Q */
/* 146 */ ED_INSERT, /* M-^R */ /* 146 */ ED_UNASSIGNED, /* M-^R */
/* 147 */ ED_INSERT, /* M-^S */ /* 147 */ ED_UNASSIGNED, /* M-^S */
/* 148 */ ED_INSERT, /* M-^T */ /* 148 */ ED_UNASSIGNED, /* M-^T */
/* 149 */ ED_INSERT, /* M-^U */ /* 149 */ ED_UNASSIGNED, /* M-^U */
/* 150 */ ED_INSERT, /* M-^V */ /* 150 */ ED_UNASSIGNED, /* M-^V */
/* 151 */ ED_INSERT, /* M-^W */ /* 151 */ ED_UNASSIGNED, /* M-^W */
/* 152 */ ED_INSERT, /* M-^X */ /* 152 */ ED_UNASSIGNED, /* M-^X */
/* 153 */ ED_INSERT, /* M-^Y */ /* 153 */ ED_UNASSIGNED, /* M-^Y */
/* 154 */ ED_INSERT, /* M-^Z */ /* 154 */ ED_UNASSIGNED, /* M-^Z */
/* 155 */ ED_INSERT, /* M-^[ */ /* 155 */ ED_UNASSIGNED, /* M-^[ */
/* 156 */ ED_INSERT, /* M-^\ */ /* 156 */ ED_UNASSIGNED, /* M-^\ */
/* 157 */ ED_INSERT, /* M-^] */ /* 157 */ ED_UNASSIGNED, /* M-^] */
/* 158 */ ED_INSERT, /* M-^^ */ /* 158 */ ED_UNASSIGNED, /* M-^^ */
/* 159 */ ED_INSERT, /* M-^_ */ /* 159 */ EM_COPY_PREV_WORD, /* M-^_ */
/* 160 */ ED_INSERT, /* M-SPACE */ /* 160 */ ED_UNASSIGNED, /* M-SPACE */
/* 161 */ ED_INSERT, /* M-! */ /* 161 */ ED_UNASSIGNED, /* M-! */
/* 162 */ ED_INSERT, /* M-" */ /* 162 */ ED_UNASSIGNED, /* M-" */
/* 163 */ ED_INSERT, /* M-# */ /* 163 */ ED_UNASSIGNED, /* M-# */
/* 164 */ ED_INSERT, /* M-$ */ /* 164 */ ED_UNASSIGNED, /* M-$ */
/* 165 */ ED_INSERT, /* M-% */ /* 165 */ ED_UNASSIGNED, /* M-% */
/* 166 */ ED_INSERT, /* M-& */ /* 166 */ ED_UNASSIGNED, /* M-& */
/* 167 */ ED_INSERT, /* M-' */ /* 167 */ ED_UNASSIGNED, /* M-' */
/* 168 */ ED_INSERT, /* M-( */ /* 168 */ ED_UNASSIGNED, /* M-( */
/* 169 */ ED_INSERT, /* M-) */ /* 169 */ ED_UNASSIGNED, /* M-) */
/* 170 */ ED_INSERT, /* M-* */ /* 170 */ ED_UNASSIGNED, /* M-* */
/* 171 */ ED_INSERT, /* M-+ */ /* 171 */ ED_UNASSIGNED, /* M-+ */
/* 172 */ ED_INSERT, /* M-, */ /* 172 */ ED_UNASSIGNED, /* M-, */
/* 173 */ ED_INSERT, /* M-- */ /* 173 */ ED_UNASSIGNED, /* M-- */
/* 174 */ ED_INSERT, /* M-. */ /* 174 */ ED_UNASSIGNED, /* M-. */
/* 175 */ ED_INSERT, /* M-/ */ /* 175 */ ED_UNASSIGNED, /* M-/ */
/* 176 */ ED_INSERT, /* M-0 */ /* 176 */ ED_ARGUMENT_DIGIT, /* M-0 */
/* 177 */ ED_INSERT, /* M-1 */ /* 177 */ ED_ARGUMENT_DIGIT, /* M-1 */
/* 178 */ ED_INSERT, /* M-2 */ /* 178 */ ED_ARGUMENT_DIGIT, /* M-2 */
/* 179 */ ED_INSERT, /* M-3 */ /* 179 */ ED_ARGUMENT_DIGIT, /* M-3 */
/* 180 */ ED_INSERT, /* M-4 */ /* 180 */ ED_ARGUMENT_DIGIT, /* M-4 */
/* 181 */ ED_INSERT, /* M-5 */ /* 181 */ ED_ARGUMENT_DIGIT, /* M-5 */
/* 182 */ ED_INSERT, /* M-6 */ /* 182 */ ED_ARGUMENT_DIGIT, /* M-6 */
/* 183 */ ED_INSERT, /* M-7 */ /* 183 */ ED_ARGUMENT_DIGIT, /* M-7 */
/* 184 */ ED_INSERT, /* M-8 */ /* 184 */ ED_ARGUMENT_DIGIT, /* M-8 */
/* 185 */ ED_INSERT, /* M-9 */ /* 185 */ ED_ARGUMENT_DIGIT, /* M-9 */
/* 186 */ ED_INSERT, /* M-: */ /* 186 */ ED_UNASSIGNED, /* M-: */
/* 187 */ ED_INSERT, /* M-; */ /* 187 */ ED_UNASSIGNED, /* M-; */
/* 188 */ ED_INSERT, /* M-< */ /* 188 */ ED_UNASSIGNED, /* M-< */
/* 189 */ ED_INSERT, /* M-= */ /* 189 */ ED_UNASSIGNED, /* M-= */
/* 190 */ ED_INSERT, /* M-> */ /* 190 */ ED_UNASSIGNED, /* M-> */
/* 191 */ ED_INSERT, /* M-? */ /* 191 */ ED_UNASSIGNED, /* M-? */
/* 192 */ ED_INSERT, /* M-@ */ /* 192 */ ED_UNASSIGNED, /* M-@ */
/* 193 */ ED_INSERT, /* M-A */ /* 193 */ ED_UNASSIGNED, /* M-A */
/* 194 */ ED_INSERT, /* M-B */ /* 194 */ ED_PREV_WORD, /* M-B */
/* 195 */ ED_INSERT, /* M-C */ /* 195 */ EM_CAPITOL_CASE, /* M-C */
/* 196 */ ED_INSERT, /* M-D */ /* 196 */ EM_DELETE_NEXT_WORD, /* M-D */
/* 197 */ ED_INSERT, /* M-E */ /* 197 */ ED_UNASSIGNED, /* M-E */
/* 198 */ ED_INSERT, /* M-F */ /* 198 */ EM_NEXT_WORD, /* M-F */
/* 199 */ ED_INSERT, /* M-G */ /* 199 */ ED_UNASSIGNED, /* M-G */
/* 200 */ ED_INSERT, /* M-H */ /* 200 */ ED_UNASSIGNED, /* M-H */
/* 201 */ ED_INSERT, /* M-I */ /* 201 */ ED_UNASSIGNED, /* M-I */
/* 202 */ ED_INSERT, /* M-J */ /* 202 */ ED_UNASSIGNED, /* M-J */
/* 203 */ ED_INSERT, /* M-K */ /* 203 */ ED_UNASSIGNED, /* M-K */
/* 204 */ ED_INSERT, /* M-L */ /* 204 */ EM_LOWER_CASE, /* M-L */
/* 205 */ ED_INSERT, /* M-M */ /* 205 */ ED_UNASSIGNED, /* M-M */
/* 206 */ ED_INSERT, /* M-N */ /* 206 */ ED_SEARCH_NEXT_HISTORY, /* M-N */
/* 207 */ ED_INSERT, /* M-O */ /* 207 */ ED_SEQUENCE_LEAD_IN, /* M-O */
/* 208 */ ED_INSERT, /* M-P */ /* 208 */ ED_SEARCH_PREV_HISTORY, /* M-P */
/* 209 */ ED_INSERT, /* M-Q */ /* 209 */ ED_UNASSIGNED, /* M-Q */
/* 210 */ ED_INSERT, /* M-R */ /* 210 */ ED_UNASSIGNED, /* M-R */
/* 211 */ ED_INSERT, /* M-S */ /* 211 */ ED_UNASSIGNED, /* M-S */
/* 212 */ ED_INSERT, /* M-T */ /* 212 */ ED_UNASSIGNED, /* M-T */
/* 213 */ ED_INSERT, /* M-U */ /* 213 */ EM_UPPER_CASE, /* M-U */
/* 214 */ ED_INSERT, /* M-V */ /* 214 */ ED_UNASSIGNED, /* M-V */
/* 215 */ ED_INSERT, /* M-W */ /* 215 */ EM_COPY_REGION, /* M-W */
/* 216 */ ED_INSERT, /* M-X */ /* 216 */ ED_COMMAND, /* M-X */
/* 217 */ ED_INSERT, /* M-Y */ /* 217 */ ED_UNASSIGNED, /* M-Y */
/* 218 */ ED_INSERT, /* M-Z */ /* 218 */ ED_UNASSIGNED, /* M-Z */
/* 219 */ ED_INSERT, /* M-[ */ /* 219 */ ED_SEQUENCE_LEAD_IN, /* M-[ */
/* 220 */ ED_INSERT, /* M-\ */ /* 220 */ ED_UNASSIGNED, /* M-\ */
/* 221 */ ED_INSERT, /* M-] */ /* 221 */ ED_UNASSIGNED, /* M-] */
/* 222 */ ED_INSERT, /* M-^ */ /* 222 */ ED_UNASSIGNED, /* M-^ */
/* 223 */ ED_INSERT, /* M-_ */ /* 223 */ ED_UNASSIGNED, /* M-_ */
/* 223 */ ED_INSERT, /* M-` */ /* 223 */ ED_UNASSIGNED, /* M-` */
/* 224 */ ED_INSERT, /* M-a */ /* 224 */ ED_UNASSIGNED, /* M-a */
/* 225 */ ED_INSERT, /* M-b */ /* 225 */ ED_PREV_WORD, /* M-b */
/* 226 */ ED_INSERT, /* M-c */ /* 226 */ EM_CAPITOL_CASE, /* M-c */
/* 227 */ ED_INSERT, /* M-d */ /* 227 */ EM_DELETE_NEXT_WORD, /* M-d */
/* 228 */ ED_INSERT, /* M-e */ /* 228 */ ED_UNASSIGNED, /* M-e */
/* 229 */ ED_INSERT, /* M-f */ /* 229 */ EM_NEXT_WORD, /* M-f */
/* 230 */ ED_INSERT, /* M-g */ /* 230 */ ED_UNASSIGNED, /* M-g */
/* 231 */ ED_INSERT, /* M-h */ /* 231 */ ED_UNASSIGNED, /* M-h */
/* 232 */ ED_INSERT, /* M-i */ /* 232 */ ED_UNASSIGNED, /* M-i */
/* 233 */ ED_INSERT, /* M-j */ /* 233 */ ED_UNASSIGNED, /* M-j */
/* 234 */ ED_INSERT, /* M-k */ /* 234 */ ED_UNASSIGNED, /* M-k */
/* 235 */ ED_INSERT, /* M-l */ /* 235 */ EM_LOWER_CASE, /* M-l */
/* 236 */ ED_INSERT, /* M-m */ /* 236 */ ED_UNASSIGNED, /* M-m */
/* 237 */ ED_INSERT, /* M-n */ /* 237 */ ED_SEARCH_NEXT_HISTORY, /* M-n */
/* 238 */ ED_INSERT, /* M-o */ /* 238 */ ED_UNASSIGNED, /* M-o */
/* 239 */ ED_INSERT, /* M-p */ /* 239 */ ED_SEARCH_PREV_HISTORY, /* M-p */
/* 240 */ ED_INSERT, /* M-q */ /* 240 */ ED_UNASSIGNED, /* M-q */
/* 241 */ ED_INSERT, /* M-r */ /* 241 */ ED_UNASSIGNED, /* M-r */
/* 242 */ ED_INSERT, /* M-s */ /* 242 */ ED_UNASSIGNED, /* M-s */
/* 243 */ ED_INSERT, /* M-t */ /* 243 */ ED_UNASSIGNED, /* M-t */
/* 244 */ ED_INSERT, /* M-u */ /* 244 */ EM_UPPER_CASE, /* M-u */
/* 245 */ ED_INSERT, /* M-v */ /* 245 */ ED_UNASSIGNED, /* M-v */
/* 246 */ ED_INSERT, /* M-w */ /* 246 */ EM_COPY_REGION, /* M-w */
/* 247 */ ED_INSERT, /* M-x */ /* 247 */ ED_COMMAND, /* M-x */
/* 248 */ ED_INSERT, /* M-y */ /* 248 */ ED_UNASSIGNED, /* M-y */
/* 249 */ ED_INSERT, /* M-z */ /* 249 */ ED_UNASSIGNED, /* M-z */
/* 250 */ ED_INSERT, /* M-{ */ /* 250 */ ED_UNASSIGNED, /* M-{ */
/* 251 */ ED_INSERT, /* M-| */ /* 251 */ ED_UNASSIGNED, /* M-| */
/* 252 */ ED_INSERT, /* M-} */ /* 252 */ ED_UNASSIGNED, /* M-} */
/* 253 */ ED_INSERT, /* M-~ */ /* 253 */ ED_UNASSIGNED, /* M-~ */
/* 254 */ ED_INSERT /* M-^? */ /* 254 */ ED_DELETE_PREV_WORD /* M-^? */
/* 255 */ /* 255 */
}; };
......
...@@ -93,7 +93,7 @@ private void ...@@ -93,7 +93,7 @@ private void
re_addc(EditLine *el, int c) re_addc(EditLine *el, int c)
{ {
if (isprint(c) || ((unsigned char)c)>127) { if (isprint(c)) {
re_putc(el, c, 1); re_putc(el, c, 1);
return; return;
} }
...@@ -954,7 +954,7 @@ re_refresh_cursor(EditLine *el) ...@@ -954,7 +954,7 @@ re_refresh_cursor(EditLine *el)
h = 1; h = 1;
v++; v++;
} }
} else if (!isprint((unsigned char) c) || ((unsigned char)c)>127) { } else if (!isprint((unsigned char) c)) {
h += 3; h += 3;
if (h > th) { /* if overflow, compensate */ if (h > th) { /* if overflow, compensate */
h = h - th; h = h - th;
...@@ -1047,7 +1047,7 @@ re_fastaddc(EditLine *el) ...@@ -1047,7 +1047,7 @@ re_fastaddc(EditLine *el)
char mc = (c == '\177') ? '?' : (c | 0100); char mc = (c == '\177') ? '?' : (c | 0100);
re_fastputc(el, '^'); re_fastputc(el, '^');
re_fastputc(el, mc); re_fastputc(el, mc);
} else if (isprint((unsigned char) c) || ((unsigned char)c)>127) { /* normal char */ } else if (isprint((unsigned char) c)) { /* normal char */
re_fastputc(el, c); re_fastputc(el, c);
} else { } else {
re_fastputc(el, '\\'); re_fastputc(el, '\\');
......
...@@ -2211,7 +2211,7 @@ then ...@@ -2211,7 +2211,7 @@ then
else else
MYSQL_CHECK_LIBEDIT_INTERFACE MYSQL_CHECK_LIBEDIT_INTERFACE
MYSQL_CHECK_NEW_RL_INTERFACE MYSQL_CHECK_NEW_RL_INTERFACE
if ["$mysql_cv_new_rl_interface"="yes"] || [test "$mysql_cv_libedit_interface"="no"] if [test "$mysql_cv_new_rl_interface" = "yes"] || [test "$mysql_cv_libedit_interface" = "no"]
then then
readline_link="-lreadline" readline_link="-lreadline"
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment