diff --git a/check.t b/check.t index a6bfb98..0c4467a 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.225 2008/09/30 18:43:06 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.226 2008/09/30 19:36: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 $ @@ -1850,15 +1850,17 @@ file-setup: file 644 "Env" stdin: echo abc def echo ghi jkl + : fc -e - echo - fc -l 2 4 + fc -l 2 5 expected-stdout: abc def ghi jkl ghi jkl 2 echo ghi jkl - 3 echo ghi jkl - 4 fc -l 2 4 + 3 : + 4 echo ghi jkl + 5 fc -l 2 5 expected-stderr-pattern: /^X*echo ghi jkl\nX*$/ --- diff --git a/histrap.c b/histrap.c index 4585c2a..20bab98 100644 --- a/histrap.c +++ b/histrap.c @@ -3,7 +3,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.69 2008/09/30 19:25:51 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.70 2008/09/30 19:36:16 tg Exp $"); /*- * MirOS: This is the default mapping type, and need not be specified. @@ -280,8 +280,7 @@ hist_execute(char *cmd) if (!*q) /* ignore trailing newline */ q = NULL; } - /* setting ignoredups to true breaks history-e-minus-5 */ - histsave(&hist_source->line, p, true, false); + histsave(&hist_source->line, p, true, true); shellf("%s\n", p); /* POSIX doesn't say this is done... */ if ((p = q)) /* restore \n (trailing \n not restored) */