fix ifs.sh; anonymous submission (mkt?), 10x
This commit is contained in:
parent
5070ea2387
commit
0b3d21702a
18
eval.c
18
eval.c
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "sh.h"
|
#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
|
* string expansion
|
||||||
|
@ -863,11 +863,19 @@ expand(const char *cp, /* input word */
|
||||||
fdo = 0;
|
fdo = 0;
|
||||||
saw_eq = 0;
|
saw_eq = 0;
|
||||||
tilde_ok = (f & (DOTILDE|DOASNTILDE)) ? 1 : 0;
|
tilde_ok = (f & (DOTILDE|DOASNTILDE)) ? 1 : 0;
|
||||||
if (c != 0)
|
if (c == 0)
|
||||||
Xinit(ds, dp, 128, ATEMP);
|
return;
|
||||||
}
|
Xinit(ds, dp, 128, ATEMP);
|
||||||
if (c == 0)
|
} else if (c == 0) {
|
||||||
return;
|
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)
|
if (word != IFS_NWS)
|
||||||
word = ctype(c, C_IFSWS) ? IFS_WS : IFS_NWS;
|
word = ctype(c, C_IFSWS) ? IFS_WS : IFS_NWS;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue