commit patch from LP#1381965 and two testcases, one showing this is fixed,

another showing deeper problems (probably LP#1381993 “non-list contexts” or
the IFS_WS/IFS_IWS story, perhaps *all* IFS_WS (not just ternaries) really
should be IFS_IWS instead?)
This commit is contained in:
tg
2014-10-19 20:56:33 +00:00
parent 996e05548a
commit 2fd0482761
3 changed files with 36 additions and 9 deletions

6
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.153 2014/10/07 15:22:16 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.154 2014/10/19 20:56:32 tg Exp $");
/*
* string expansion
@ -631,7 +631,7 @@ expand(
*/
if (!Flag(FSH)) {
*dp++ = MAGIC;
*dp++ = '@' | 0x80;
*dp++ = 0x80 | '@';
}
break;
case '=':
@ -664,7 +664,7 @@ expand(
f |= DOTEMP;
/* FALLTHROUGH */
default:
word = quote ? IFS_WORD : IFS_IWS;
word = quote || (!*x.str && (f & DOASNFIELD)) ? IFS_WORD : IFS_WS;
/* Enable tilde expansion */
tilde_ok = 1;
f |= DOTILDE;