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: 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: 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 $ # $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 Check some things in the LEGACY KSH
category: shell:legacy-yes category: shell:legacy-yes
stdin: stdin:
(set -o emacs); echo 1 = $? . set +o emacs
(set -o vi); echo 2 = $? . 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: expected-stdout:
1 = 1 . 2=emacs
2 = 1 . 2=vi
expected-stderr-pattern:
/set: emacs: bad option\n.*set: vi: bad option/
--- ---
name: selftest-direct-builtin-call name: selftest-direct-builtin-call
description: description:

View File

@ -1,5 +1,5 @@
#if defined(SHFLAGS_DEFNS) #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 */ #define FN(sname,cname,ochar,flags) /* nothing */
#elif defined(SHFLAGS_ENUMS) #elif defined(SHFLAGS_ENUMS)
#define FN(sname,cname,ochar,flags) cname, #define FN(sname,cname,ochar,flags) cname,
@ -29,7 +29,7 @@ FN("bgnice", FBGNICE, 0, OF_ANY)
/* ./. enable {} globbing (non-standard) */ /* ./. enable {} globbing (non-standard) */
FN("braceexpand", FBRACEEXPAND, 0, OF_ANY) 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 */ /* ./. Emacs command line editing mode */
FN("emacs", FEMACS, 0, OF_ANY) FN("emacs", FEMACS, 0, OF_ANY)
#endif #endif
@ -37,7 +37,7 @@ FN("emacs", FEMACS, 0, OF_ANY)
/* -e quit on error */ /* -e quit on error */
FN("errexit", FERREXIT, 'e', OF_ANY) 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 */ /* ./. Emacs command line editing mode, gmacs variant */
FN("gmacs", FGMACS, 0, OF_ANY) FN("gmacs", FGMACS, 0, OF_ANY)
#endif #endif
@ -112,7 +112,7 @@ FN("utf8-mode", FUNICODE, 'U', OF_ANY)
/* -v echo input */ /* -v echo input */
FN("verbose", FVERBOSE, 'v', OF_ANY) 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 */ /* ./. Vi command line editing mode */
FN("vi", FVI, 0, OF_ANY) FN("vi", FVI, 0, OF_ANY)