commitid 10056D5D8AF01B31531 broke fix for Debian #783978 (add testsuite)

This commit is contained in:
tg 2016-04-09 13:55:12 +00:00
parent 838833ba86
commit 4c4131dddf
3 changed files with 39 additions and 7 deletions

37
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.728 2016/03/05 15:39:36 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.729 2016/04/09 13:55:09 tg Exp $
# -*- mode: sh -*- # -*- mode: sh -*-
#- #-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -30,7 +30,7 @@
# (2013/12/02 20:39:44) http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date # (2013/12/02 20:39:44) http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R52 2016/03/04 @(#)MIRBSD KSH R52 2016/04/09
description: description:
Check version of shell. Check version of shell.
stdin: stdin:
@ -39,7 +39,7 @@ name: KSH_VERSION
category: shell:legacy-no category: shell:legacy-no
--- ---
expected-stdout: expected-stdout:
@(#)LEGACY KSH R52 2016/03/04 @(#)LEGACY KSH R52 2016/04/09
description: description:
Check version of legacy shell. Check version of legacy shell.
stdin: stdin:
@ -3173,6 +3173,37 @@ expected-stdout:
expected-stderr-pattern: expected-stderr-pattern:
/(.*can't unlink HISTFILE.*\n)?X*$/ /(.*can't unlink HISTFILE.*\n)?X*$/
--- ---
name: history-multiline
description:
Check correct multiline history, Debian #783978
need-ctty: yes
arguments: !-i!
env-setup: !ENV=./Env!
file-setup: file 644 "Env"
PS1=X
PS2=Y
stdin:
for i in A B C
do
print $i
print $i
done
fc -l
expected-stdout:
A
A
B
B
C
C
1 for i in A B C
do
print $i
print $i
done
expected-stderr-pattern:
/^XYYYYXX$/
---
name: history-e-minus-1 name: history-e-minus-1
description: description:
Check if more recent command is executed Check if more recent command is executed

5
lex.c
View File

@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.222 2016/03/01 19:22:31 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/lex.c,v 1.223 2016/04/09 13:55:11 tg Exp $");
/* /*
* states while lexing word * states while lexing word
@ -1350,7 +1350,8 @@ getsc_line(Source *s)
alarm(ksh_tmout); alarm(ksh_tmout);
} }
if (interactive) { if (interactive) {
histsave(&s->line, NULL, HIST_FLUSH, true); if (cur_prompt == PS1)
histsave(&s->line, NULL, HIST_FLUSH, true);
change_winsz(); change_winsz();
} }
#ifndef MKSH_NO_CMDLINE_EDITING #ifndef MKSH_NO_CMDLINE_EDITING

4
sh.h
View File

@ -175,9 +175,9 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.768 2016/03/04 18:28:42 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.769 2016/04/09 13:55:12 tg Exp $");
#endif #endif
#define MKSH_VERSION "R52 2016/03/04" #define MKSH_VERSION "R52 2016/04/09"
/* arithmetic types: C implementation */ /* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES #if !HAVE_CAN_INTTYPES