From fc4f36e75b57d89d8b4d36c2b79d7ee184d889b4 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 30 Nov 2013 00:20:48 +0000 Subject: [PATCH] revert commit 1005289433447F6CA90 as it makes the system unbootable --- check.t | 32 ++++++++++++++++++++++++++------ eval.c | 3 +-- sh.h | 4 ++-- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/check.t b/check.t index d07e2a8..6d6cd0b 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.635 2013/11/17 22:28:49 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.636 2013/11/30 00:20:46 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 $ @@ -31,7 +31,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R48 2013/11/17 + @(#)MIRBSD KSH R48 2013/11/29 description: Check version of shell. stdin: @@ -40,7 +40,7 @@ name: KSH_VERSION category: shell:legacy-no --- expected-stdout: - @(#)LEGACY KSH R48 2013/11/17 + @(#)LEGACY KSH R48 2013/11/29 description: Check version of legacy shell. stdin: @@ -2126,6 +2126,18 @@ stdin: expected-stdout: -bc abc bbc cbc ebc --- +name: glob-trim-1 +description: + Check against a regression from fixing IFS-subst-2 +stdin: + x='#foo' + print -r "before='$x'" + x=${x%%#*} + print -r "after ='$x'" +expected-stdout: + before='#foo' + after ='' +--- name: heredoc-1 description: Check ordering/content of redundent here documents. @@ -3674,8 +3686,6 @@ stdin: x=" A : B::D" echo -n '12:'; for i in $x ; do echo -n " [$i]" ; done ; echo showargs 13 $x - x="X 1 2" - showargs 14 shift ${x#X} expected-stdout: 1: [] [b] [] 2: [:b::] @@ -3690,7 +3700,17 @@ expected-stdout: <11> 12: [A] [B] [] [D] <13> <> - <14> <1> <2> +--- +name: IFS-subst-2 +description: + Check leading whitespace after trim does not make a field +expected-fail: yes +stdin: + showargs() { for i; do echo -n " <$i>"; done; echo; } + x="X 1 2" + showargs 1 shift ${x#X} +expected-stdout: + <1> <1> <2> --- name: integer-base-err-1 description: diff --git a/eval.c b/eval.c index 02cff44..23a8544 100644 --- a/eval.c +++ b/eval.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.144 2013/11/17 22:28:51 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.145 2013/11/30 00:20:47 tg Exp $"); /* * string expansion @@ -719,7 +719,6 @@ expand( */ x.str = trimsub(str_val(st->var), dp, st->stype); - word = quote ? IFS_WORD : IFS_WS; if (quote || x.str[0] != '\0') type = XSUB; else diff --git a/sh.h b/sh.h index 982d8fc..bf06b10 100644 --- a/sh.h +++ b/sh.h @@ -164,9 +164,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.676 2013/11/17 22:28:51 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.677 2013/11/30 00:20:48 tg Exp $"); #endif -#define MKSH_VERSION "R48 2013/11/17" +#define MKSH_VERSION "R48 2013/11/29" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES