fix ifs.sh; anonymous submission (mkt?), 10x

This commit is contained in:
tg 2011-12-16 20:03:12 +00:00
parent 5070ea2387
commit 0b3d21702a
1 changed files with 13 additions and 5 deletions

16
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.110 2011/11/26 00:45:20 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.111 2011/12/16 20:03:12 tg Exp $");
/*
* string expansion
@ -863,11 +863,19 @@ expand(const char *cp, /* input word */
fdo = 0;
saw_eq = 0;
tilde_ok = (f & (DOTILDE|DOASNTILDE)) ? 1 : 0;
if (c != 0)
Xinit(ds, dp, 128, ATEMP);
}
if (c == 0)
return;
Xinit(ds, dp, 128, ATEMP);
} else if (c == 0) {
return;
} else if (type == XSUB && ctype(c, C_IFS) &&
!ctype(c, C_IFSWS) && Xlength(ds, dp) == 0) {
char *p;
*(p = alloc(1, ATEMP)) = '\0';
XPput(*wp, p);
type = XSUBMID;
}
if (word != IFS_NWS)
word = ctype(c, C_IFSWS) ? IFS_WS : IFS_NWS;
} else {