1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

tests/pty.sh: Add a regression test for a ksh93r crash (re: 129614b9) (#227)

In ksh93r a crash can occur after switching from emacs mode to vi
mode[*]:
    $ ENV=/./dev/null ksh2006 -o emacs
    $ echo ${.sh.version}
    Version M 1993-12-28 r
    $ set -o vi
    $ <Esc> <r> <r>  # This triggers the memory fault
Commit 129614b9 added the OpenSUSE patch for this crash. This commit
adds the regression test for it.

[*]: https://bugzilla.opensuse.org/show_bug.cgi?id=179917
This commit is contained in:
Johnothan King 2021-03-17 01:46:21 -07:00 committed by GitHub
parent 14352ba0a7
commit 5ca7c325e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -733,5 +733,22 @@ w echo "Exit status is: $?"
u Exit status is: 1 u Exit status is: 1
! !
((SHOPT_ESH)) && ((SHOPT_VSH)) && tst $LINENO <<"!"
L crash after switching from emacs to vi mode
# In ksh93r using the vi 'r' command after switching from emacs mode could
# trigger a memory fault: https://bugzilla.opensuse.org/show_bug.cgi?id=179917
d 15
w exec $SHELL -o emacs
u emacs
w set -o vi
u set -o vi
c \Erri
w echo Success
u echo
r ^Success\r?\n$
!
# ====== # ======
exit $((Errors<125?Errors:125)) exit $((Errors<125?Errors:125))