better fix

This commit is contained in:
tg 2014-10-19 21:39:37 +00:00
parent 67d8c69353
commit cf2609f3fa
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.664 2014/10/19 20:56:30 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.665 2014/10/19 21:39:35 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,
@ -3770,7 +3770,6 @@ expected-stdout:
name: IFS-subst-3-ass name: IFS-subst-3-ass
description: description:
Check non-field semantics Check non-field semantics
expected-fail: yes
stdin: stdin:
showargs() { for i; do echo -n " <$i>"; done; echo; } showargs() { for i; do echo -n " <$i>"; done; echo; }
showargs 0 x=${-+} showargs 0 x=${-+}

9
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.156 2014/10/19 21:04:47 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.157 2014/10/19 21:39:37 tg Exp $");
/* /*
* string expansion * string expansion
@ -664,7 +664,11 @@ expand(
f |= DOTEMP; f |= DOTEMP;
/* FALLTHROUGH */ /* FALLTHROUGH */
default: default:
word = quote || (!*x.str && (f & DOASNFIELD)) ? IFS_WORD : IFS_IWS; /* '-' '+' '?' */
if (quote)
word = IFS_WORD;
else if (dp == Xstring(ds, dp))
word = IFS_IWS;
/* Enable tilde expansion */ /* Enable tilde expansion */
tilde_ok = 1; tilde_ok = 1;
f |= DOTILDE; f |= DOTILDE;
@ -764,6 +768,7 @@ expand(
doblank++; doblank++;
st = st->prev; st = st->prev;
continue; continue;
/* default: '-' '+' */
} }
st = st->prev; st = st->prev;
type = XBASE; type = XBASE;