From 43df0a21c0dfa9536b0c8ce816685a6002451f54 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 11 Mar 2010 22:38:58 +0000 Subject: 27785: IFS doesn't have a null in it in POSIX unposted: note & needs quoting in :s in glob qualifier --- Src/utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index b5cdc4613..38c820f29 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3271,7 +3271,8 @@ inittyptab(void) typtab[t0] |= ITOK | IMETA; for (t0 = (int)STOUC(Snull); t0 <= (int)STOUC(Nularg); t0++) typtab[t0] |= ITOK | IMETA | INULL; - for (s = ifs ? ifs : DEFAULT_IFS; *s; s++) { + for (s = ifs ? ifs : EMULATION(EMULATE_KSH|EMULATE_SH) ? + ztrdup(DEFAULT_IFS_SH) : ztrdup(DEFAULT_IFS); *s; s++) { int c = STOUC(*s == Meta ? *++s ^ 32 : *s); #ifdef MULTIBYTE_SUPPORT if (!isascii(c)) { @@ -3305,7 +3306,8 @@ inittyptab(void) } #ifdef MULTIBYTE_SUPPORT set_widearray(wordchars, &wordchars_wide); - set_widearray(ifs ? ifs : DEFAULT_IFS, &ifs_wide); + set_widearray(ifs ? ifs : EMULATION(EMULATE_KSH|EMULATE_SH) ? + ztrdup(DEFAULT_IFS_SH) : ztrdup(DEFAULT_IFS), &ifs_wide); #endif for (s = SPECCHARS; *s; s++) typtab[STOUC(*s)] |= ISPECIAL; -- cgit v1.2.3