fix emacs/vi lksh

This commit is contained in:
tg 2012-06-28 20:14:17 +00:00
parent e111b33d9a
commit ae26f45417
2 changed files with 15 additions and 11 deletions

18
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.547 2012/06/28 20:05:05 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.548 2012/06/28 20:14:15 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -84,13 +84,17 @@ description:
Check some things in the LEGACY KSH
category: shell:legacy-yes
stdin:
(set -o emacs); echo 1 = $? .
(set -o vi); echo 2 = $? .
set +o emacs
set +o vi
[[ "$(set +o) -o" = *"-o emacs -o"* ]] && echo 1=emacs
[[ "$(set +o) -o" = *"-o vi -o"* ]] && echo 1=vi
set -o emacs
set -o vi
[[ "$(set +o) -o" = *"-o emacs -o"* ]] && echo 2=emacs
[[ "$(set +o) -o" = *"-o vi -o"* ]] && echo 2=vi
expected-stdout:
1 = 1 .
2 = 1 .
expected-stderr-pattern:
/set: emacs: bad option\n.*set: vi: bad option/
2=emacs
2=vi
---
name: selftest-direct-builtin-call
description:

View File

@ -1,5 +1,5 @@
#if defined(SHFLAGS_DEFNS)
__RCSID("$MirOS: src/bin/mksh/sh_flags.h,v 1.11 2012/06/28 20:09:30 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh_flags.h,v 1.12 2012/06/28 20:14:17 tg Exp $");
#define FN(sname,cname,ochar,flags) /* nothing */
#elif defined(SHFLAGS_ENUMS)
#define FN(sname,cname,ochar,flags) cname,
@ -29,7 +29,7 @@ FN("bgnice", FBGNICE, 0, OF_ANY)
/* ./. enable {} globbing (non-standard) */
FN("braceexpand", FBRACEEXPAND, 0, OF_ANY)
#if !defined(MKSH_NO_CMDLINE_EDITING) && !defined(MKSH_LEGACY_MODE)
#if !defined(MKSH_NO_CMDLINE_EDITING) || defined(MKSH_LEGACY_MODE)
/* ./. Emacs command line editing mode */
FN("emacs", FEMACS, 0, OF_ANY)
#endif
@ -37,7 +37,7 @@ FN("emacs", FEMACS, 0, OF_ANY)
/* -e quit on error */
FN("errexit", FERREXIT, 'e', OF_ANY)
#if !defined(MKSH_NO_CMDLINE_EDITING) && !defined(MKSH_LEGACY_MODE)
#if !defined(MKSH_NO_CMDLINE_EDITING) || defined(MKSH_LEGACY_MODE)
/* ./. Emacs command line editing mode, gmacs variant */
FN("gmacs", FGMACS, 0, OF_ANY)
#endif
@ -112,7 +112,7 @@ FN("utf8-mode", FUNICODE, 'U', OF_ANY)
/* -v echo input */
FN("verbose", FVERBOSE, 'v', OF_ANY)
#if !defined(MKSH_NO_CMDLINE_EDITING) && !defined(MKSH_LEGACY_MODE)
#if !defined(MKSH_NO_CMDLINE_EDITING) || defined(MKSH_LEGACY_MODE)
/* ./. Vi command line editing mode */
FN("vi", FVI, 0, OF_ANY)