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