PR/54853: Greg Oster: unable to 'unset filec' or 'unset edit' in csh

While here allow set edit=vi
This commit is contained in:
christos 2020-01-12 03:50:30 +00:00
parent 49eb82c34f
commit a02ac89d43

View File

@ -1,4 +1,4 @@
/* $NetBSD: set.c,v 1.35 2019/01/05 16:54:00 christos Exp $ */
/* $NetBSD: set.c,v 1.36 2020/01/12 03:50:30 christos Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: set.c,v 1.35 2019/01/05 16:54:00 christos Exp $");
__RCSID("$NetBSD: set.c,v 1.36 2020/01/12 03:50:30 christos Exp $");
#endif
#endif /* not lint */
@ -117,10 +117,12 @@ update_vars(Char *vp)
#ifdef EDIT
else if (eq(vp, STRedit)) {
HistEvent ev;
Char *vn = value(STRhistchars);
editing = 1;
el = el_init_fd(getprogname(), cshin, cshout, csherr,
SHIN, SHOUT, SHERR);
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_EDITOR, *vn ? short2str(vn) : "emacs");
el_set(el, EL_PROMPT, printpromptstr);
hi = history_init();
history(hi, &ev, H_SETSIZE, getn(value(STRhistory)));
@ -518,16 +520,18 @@ unset(Char **v, struct command *t)
HIST = '!';
HISTSUB = '^';
}
else if (adrof(STRwordchars) == 0)
if (adrof(STRwordchars) == 0)
word_chars = STR_WORD_CHARS;
#ifdef FILEC
else if (adrof(STRfilec) == 0)
if (adrof(STRfilec) == 0)
filec = 0;
#endif
#ifdef EDIT
else if (adrof(STRedit) == 0) {
el_end(el);
history_end(hi);
if (adrof(STRedit) == 0) {
if (el)
el_end(el);
if (hi)
history_end(hi);
el = NULL;
hi = NULL;
editing = 0;