mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-26 06:26:41 +00:00
Bug # 2174: Respect EDITOR environment variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1262,6 +1262,7 @@ static char *cli_complete(EditLine *el, int ch)
|
|||||||
static int ast_el_initialize(void)
|
static int ast_el_initialize(void)
|
||||||
{
|
{
|
||||||
HistEvent ev;
|
HistEvent ev;
|
||||||
|
char *editor = getenv("EDITOR");
|
||||||
|
|
||||||
if (el != NULL)
|
if (el != NULL)
|
||||||
el_end(el);
|
el_end(el);
|
||||||
@@ -1272,7 +1273,7 @@ static int ast_el_initialize(void)
|
|||||||
el_set(el, EL_PROMPT, cli_prompt);
|
el_set(el, EL_PROMPT, cli_prompt);
|
||||||
|
|
||||||
el_set(el, EL_EDITMODE, 1);
|
el_set(el, EL_EDITMODE, 1);
|
||||||
el_set(el, EL_EDITOR, "emacs");
|
el_set(el, EL_EDITOR, editor ? editor : "emacs");
|
||||||
el_hist = history_init();
|
el_hist = history_init();
|
||||||
if (!el || !el_hist)
|
if (!el || !el_hist)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user