editor
editor = str_nsave(p, len, ATEMP);
strlcat(editor, " $_", len);
if (editor || lflag || nflag || rflag) {
if (editor && (lflag || nflag)) {
ret = command(editor ? editor : "${FCEDIT:-/bin/ed} $_");
char *p, *editor = (char *) 0;
const char * volatile editor = NULL;
editor = optarg;
VTRACE(DBG_HISTORY, ("histcmd -e %s\n", editor));
if (lflg == 0 || editor || sflg) {
if (editor == NULL &&
(editor = bltinlookup("FCEDIT", 1)) == NULL &&
(editor = bltinlookup("EDITOR", 1)) == NULL)
editor = DEFEDITOR;
if (editor[0] == '-' && editor[1] == '\0') {
editor = NULL;
editor == NULL ? "-nothing-" : editor));
if (editor) {
if (editor) {
cmdlen = strlen(editor) + strlen(editfile) + 2;
snprintf(editcmd, cmdlen, "%s %s", editor, editfile);
static char *editor;
if (editor == NULL) {
editor = getenv("EDITOR");
if (editor == NULL || *editor == '\0') {
editor = _PATH_VI;
(void)snprintf(buf, sizeof(buf), "%s +%d %s", editor, c,
(void)snprintf(buf, sizeof(buf), "%s %s", editor, current_file);
map_set_editor(EditLine *el, wchar_t *editor)
if (wcscmp(editor, L"emacs") == 0) {
if (wcscmp(editor, L"vi") == 0) {
map_get_editor(EditLine *el, const wchar_t **editor)
if (editor == NULL)
*editor = L"emacs";
*editor = L"vi";
const char *editor;
if ((editor = (el->el_getenv)("EDITOR")) == NULL)
editor = "vi";
execlp(editor, editor, tempfile, (char *)NULL);
const char * volatile editor;
if ((editor = getenv("EDITOR")) == NULL)
editor = _PATH_VI;
p = malloc(strlen(editor) + 1 + strlen(filename) + 1);
sprintf(p, "%s %s", editor, filename);
pw_error(editor, 1, 1);
pw_error(editor, 1, 1);
{ "edit", editor, 0, CMP(n) I|MSGLIST, 0, MMNORM },
int editor(void *);
const char *editor;
editor = getenv("VISUAL");
if (editor == NULL)
editor = getenv("EDITOR");
if (editor == NULL)
editor = "vi";
execlp(editor, editor, filename, (void *)NULL);
warn("could not execute editor: %s", editor);
warn("%s terminated abnormally", editor);