• more unsigned → unsigned int
• more int → bool • more regression tests: check if the utf8-hack flag is really disabled at non-interactive startup, enabled at interactive startup, if the current locale is a UTF-8 one • make the mksh-local multibyte handling functions globally accessible, change their names, syntax and semantics a little (XXX more work needed) • optimise • utf_wctomb: src → dst, as we’re writing to that char array (pasto?) • edit.c:x_e_getmbc(): if the second byte of a 2- or 3-byte multibyte sequence is invalid utf-8, ungetc it (not possible for the 3rd byte yet) • edit.c:x_zotc3(): easier (and faster) handling of UTF-8 • implement, document and test for base-1 numbers: they just get the ASCII (8-bit) or Unicode (UTF-8) value of the octet(s) after the ‘1#’, or do the same as print \x## or \u#### (depending on the utf8-hack flag), plus support the PUA assignment of EF80‥EFFF for the MirBSD encoding “hack” (print doesn’t, as it has \x## and \u#### to distinguish, but we cannot use base-0 numbers which I had planned to use for raw octets first, as they are used internally): http://thread.gmane.org/gmane.os.miros.general/7938 • as an application example, add a hexdumper to the regression tests ☺
This commit is contained in:
12
misc.c
12
misc.c
@ -6,7 +6,7 @@
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.74 2008/04/19 17:21:54 tg Exp $\t"
|
||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.75 2008/04/19 22:15:03 tg Exp $\t"
|
||||
MKSH_SH_H_ID);
|
||||
|
||||
#undef USE_CHVT
|
||||
@ -35,7 +35,7 @@ static char *do_phys_path(XString *, char *, const char *);
|
||||
void
|
||||
setctypes(const char *s, int t)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned int i;
|
||||
|
||||
if (t & C_IFS) {
|
||||
for (i = 0; i < UCHAR_MAX + 1; i++)
|
||||
@ -88,7 +88,7 @@ str_save(const char *s, Area *ap)
|
||||
|
||||
/* called from XcheckN() to grow buffer */
|
||||
char *
|
||||
Xcheck_grow_(XString *xsp, const char *xp, unsigned more)
|
||||
Xcheck_grow_(XString *xsp, const char *xp, unsigned int more)
|
||||
{
|
||||
const char *old_beg = xsp->beg;
|
||||
|
||||
@ -185,7 +185,7 @@ options_fmt_entry(const void *arg, int i, char *buf, int buflen)
|
||||
static void
|
||||
printoptions(int verbose)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned int i;
|
||||
|
||||
if (verbose) {
|
||||
struct options_info oi;
|
||||
@ -216,7 +216,7 @@ printoptions(int verbose)
|
||||
char *
|
||||
getoptions(void)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned int i;
|
||||
char m[(int) FNFLAGS + 1];
|
||||
char *cp = m;
|
||||
|
||||
@ -1446,7 +1446,7 @@ stristr(const char *b, const char *l)
|
||||
|
||||
#if !HAVE_EXPSTMT
|
||||
bool
|
||||
ksh_isspace_(unsigned ksh_isspace_c)
|
||||
ksh_isspace_(unsigned int ksh_isspace_c)
|
||||
{
|
||||
return ((ksh_isspace_c >= 0x09 && ksh_isspace_c <= 0x0D) ||
|
||||
(ksh_isspace_c == 0x20));
|
||||
|
Reference in New Issue
Block a user