On 2/5/14 10:51 PM, Dan Jacobson wrote:
> # su - nobody
> No directory, logging in with HOME=/
> $ cat /tmp/r
> LC_CTYPE=zh_TW.UTF-8 N=$(echo 統一|iconv -t big5 -f utf-8) sh -xc ': $N'
> $ sh /tmp/r
> /tmp/r: line 1: 4551 Segmentation fault LC_CTYPE=zh_TW.UTF-8 N=$(echo
> 統一|iconv -t big5 -f utf-8) sh -xc ': $N'
Thanks for the report. I've attached a patch that will be in bash-4.3.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3-rc2/lib/sh/strtrans.c 2013-03-09 14:55:18.000000000 -0500
--- lib/sh/strtrans.c 2014-02-06 11:10:52.000000000 -0500
***************
*** 279,284 ****
*r++ = c;
else
! for (b = 0; b < (int)clen; c = b ? *++s : c)
! *r++ = c;
}
--- 279,287 ----
*r++ = c;
else
! {
! for (b = 0; b < (int)clen; b++)
! *r++ = (unsigned char)s[b];
! s += clen - 1; /* -1 because of the increment above */
! }
}