fix initial IFSWS not ignored when expanding, noticed by Seb <sbb@tuxfamily.org>

This commit is contained in:
tg
2013-11-17 22:28:51 +00:00
parent 2008bab5a0
commit 973c7a55c2
3 changed files with 11 additions and 7 deletions

5
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.143 2013/09/24 20:19:44 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.144 2013/11/17 22:28:51 tg Exp $");
/*
* string expansion
@ -719,7 +719,8 @@ expand(
*/
x.str = trimsub(str_val(st->var),
dp, st->stype);
if (x.str[0] != '\0' || st->quotep)
word = quote ? IFS_WORD : IFS_WS;
if (quote || x.str[0] != '\0')
type = XSUB;
else
type = XNULLSUB;