mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix expansion of multibyte character after $1 - $9, $?, etc (#102)
A multibyte character immediately following an expansion of a single-character name, e.g. $1 through $9, $?, $-, etc. was corrupted when in a UTF-8 locale, e.g.: $ set -- foo; echo "$1テスト" foo?スト Prior discussion: https://www.mail-archive.com/ast-users@lists.research.att.com/msg01060.html https://bugzilla.redhat.com/show_bug.cgi?id=1256495 src/cmd/ksh93/sh/macro.c: - Apply a Red Hat patch by Paulo Andrade that avoids calling fcmbget() if backtracking more than one byte might be required. src/cmd/ksh93/tests/basic.c: - Test "テスト" following expansion of "$1", "$?" and "$#". Co-authored-by: Martijn Dekker <martijn@inlv.org>
This commit is contained in:
parent
02a14ff9b7
commit
4144f404ae
3 changed files with 21 additions and 1 deletions
|
@ -1506,7 +1506,10 @@ retry1:
|
|||
default:
|
||||
goto nosub;
|
||||
}
|
||||
c = fcmbget(&LEN);
|
||||
if(type)
|
||||
c = fcmbget(&LEN);
|
||||
else
|
||||
c = fcget();
|
||||
if(type>M_TREE)
|
||||
{
|
||||
if(c!=RBRACE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue