sh: Change the CTL* bytes to ones invalid in UTF-8.

This ensures that mbrtowc(3) can be used directly once it has been verified
that there is no CTL* byte. Dealing with a CTLESC byte within a multibyte
character would be complicated.

The new values do occur in iso-8859-* encodings. This decreases efficiency
slightly but should not affect correctness.

Caveat: Updating across this change and rebuilding without cleaning may
yield a subtly broken sh binary. By default, make buildworld will clean and
avoid problems.
This commit is contained in:
Jilles Tjoelker 2011-05-06 20:45:50 +00:00
parent 6533dd880e
commit c76aed958b

View File

@ -34,16 +34,16 @@
*/
/* control characters in argument strings */
#define CTLESC '\201'
#define CTLVAR '\202'
#define CTLENDVAR '\203'
#define CTLBACKQ '\204'
#define CTLESC '\300'
#define CTLVAR '\301'
#define CTLENDVAR '\371'
#define CTLBACKQ '\372'
#define CTLQUOTE 01 /* ored with CTLBACKQ code if in quotes */
/* CTLBACKQ | CTLQUOTE == '\205' */
#define CTLARI '\206'
#define CTLENDARI '\207'
#define CTLQUOTEMARK '\210'
#define CTLQUOTEEND '\211' /* only for ${v+-...} */
#define CTLARI '\374'
#define CTLENDARI '\375'
#define CTLQUOTEMARK '\376'
#define CTLQUOTEEND '\377' /* only for ${v+-...} */
/* variable substitution byte (follows CTLVAR) */
#define VSTYPE 0x0f /* type of variable substitution */