LANGUAGE CHANGE: $((…)) results are now IFS-split, as per POSIX 201x

This commit is contained in:
tg
2014-06-09 11:16:07 +00:00
parent 2f620132af
commit b7c41f240c
2 changed files with 15 additions and 17 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.649 2014/06/09 11:13:17 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.650 2014/06/09 11:16:06 tg Exp $
# OpenBSD src/regress/bin/ksh updated: 2013/12/02 20:39:44 # OpenBSD src/regress/bin/ksh updated: 2013/12/02 20:39:44
#- #-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -3736,7 +3736,6 @@ expected-stdout:
name: IFS-arith-1 name: IFS-arith-1
description: description:
http://austingroupbugs.net/view.php?id=832 http://austingroupbugs.net/view.php?id=832
expected-fail: yes
stdin: stdin:
${ZSH_VERSION+false} || emulate sh ${ZSH_VERSION+false} || emulate sh
${BASH_VERSION+set -o posix} ${BASH_VERSION+set -o posix}

13
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.149 2014/06/09 10:41:03 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.150 2014/06/09 11:16:07 tg Exp $");
/* /*
* string expansion * string expansion
@ -324,9 +324,9 @@ expand(
} }
continue; continue;
case EXPRSUB: case EXPRSUB:
word = IFS_WORD;
tilde_ok = 0; tilde_ok = 0;
if (f & DONTRUNCOMMAND) { if (f & DONTRUNCOMMAND) {
word = IFS_WORD;
*dp++ = '$'; *dp++ = '('; *dp++ = '('; *dp++ = '$'; *dp++ = '('; *dp++ = '(';
while (*sp != '\0') { while (*sp != '\0') {
Xcheck(ds, dp); Xcheck(ds, dp);
@ -343,11 +343,10 @@ expand(
v_evaluate(&v, substitute(sp, 0), v_evaluate(&v, substitute(sp, 0),
KSH_UNWIND_ERROR, true); KSH_UNWIND_ERROR, true);
sp = strnul(sp) + 1; sp = strnul(sp) + 1;
cp = str_val(&v); x.str = str_val(&v);
while (*cp) { type = XSUB;
Xcheck(ds, dp); if (f & DOBLANK)
*dp++ = *cp++; doblank++;
}
} }
continue; continue;
case OSUBST: { case OSUBST: {