fix \u0000 and \x00 being ignored in $'…' and print +r expansion

This commit is contained in:
tg
2015-10-24 19:46:10 +00:00
parent 1a4f644d6e
commit 7a47656efe
3 changed files with 34 additions and 8 deletions

7
lex.c
View File

@@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.212 2015/10/09 19:29:48 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.213 2015/10/24 19:46:10 tg Exp $");
/*
* states while lexing word
@@ -601,10 +601,11 @@ yylex(int cf)
} else {
cz = utf_wctomb(ts, c2 - 0x100);
ts[cz] = 0;
for (cz = 0; ts[cz]; ++cz) {
cz = 0;
do {
*wp++ = QCHAR;
*wp++ = ts[cz];
}
} while (ts[++cz]);
}
}
} else if (!statep->ls_bool) {