Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libedit/el.c
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | if (el->el_prog == NULL) { | ||||
el_free(el); | el_free(el); | ||||
return NULL; | return NULL; | ||||
} | } | ||||
/* | /* | ||||
* Initialize all the modules. Order is important!!! | * Initialize all the modules. Order is important!!! | ||||
*/ | */ | ||||
el->el_flags = 0; | el->el_flags = 0; | ||||
if (setlocale(LC_CTYPE, NULL) != NULL){ | |||||
if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) | |||||
el->el_flags |= CHARSET_IS_UTF8; | |||||
} | |||||
if (terminal_init(el) == -1) { | if (terminal_init(el) == -1) { | ||||
el_free(el->el_prog); | el_free(el->el_prog); | ||||
el_free(el); | el_free(el); | ||||
return NULL; | return NULL; | ||||
} | } | ||||
(void) keymacro_init(el); | (void) keymacro_init(el); | ||||
(void) map_init(el); | (void) map_init(el); | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | FUN(el,set)(EditLine *el, int op, ...) | ||||
} | } | ||||
case EL_HIST: | case EL_HIST: | ||||
{ | { | ||||
hist_fun_t func = va_arg(ap, hist_fun_t); | hist_fun_t func = va_arg(ap, hist_fun_t); | ||||
void *ptr = va_arg(ap, void *); | void *ptr = va_arg(ap, void *); | ||||
rv = hist_set(el, func, ptr); | rv = hist_set(el, func, ptr); | ||||
if (!(el->el_flags & CHARSET_IS_UTF8)) | if (MB_CUR_MAX == 1) | ||||
el->el_flags &= ~NARROW_HISTORY; | el->el_flags &= ~NARROW_HISTORY; | ||||
break; | break; | ||||
} | } | ||||
case EL_EDITMODE: | case EL_EDITMODE: | ||||
if (va_arg(ap, int)) | if (va_arg(ap, int)) | ||||
el->el_flags &= ~EDIT_DISABLED; | el->el_flags &= ~EDIT_DISABLED; | ||||
else | else | ||||
▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines |