aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c765
1 files changed, 378 insertions, 387 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 6b985ad7c..1cfef2787 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -260,9 +260,6 @@ static void trace_vprintf(const char *fmt, va_list va);
260/* ============ Utility functions */ 260/* ============ Utility functions */
261#define xbarrier() do { __asm__ __volatile__ ("": : :"memory"); } while (0) 261#define xbarrier() do { __asm__ __volatile__ ("": : :"memory"); } while (0)
262 262
263/* C99 says: "char" declaration may be signed or unsigned by default */
264#define signed_char2int(sc) ((int)(signed char)(sc))
265
266static int isdigit_str9(const char *str) 263static int isdigit_str9(const char *str)
267{ 264{
268 int maxlen = 9 + 1; /* max 9 digits: 999999999 */ 265 int maxlen = 9 + 1; /* max 9 digits: 999999999 */
@@ -711,17 +708,17 @@ trace_puts_quoted(char *s)
711 return; 708 return;
712 putc('"', tracefile); 709 putc('"', tracefile);
713 for (p = s; *p; p++) { 710 for (p = s; *p; p++) {
714 switch (*p) { 711 switch ((unsigned char)*p) {
715 case '\n': c = 'n'; goto backslash; 712 case '\n': c = 'n'; goto backslash;
716 case '\t': c = 't'; goto backslash; 713 case '\t': c = 't'; goto backslash;
717 case '\r': c = 'r'; goto backslash; 714 case '\r': c = 'r'; goto backslash;
718 case '"': c = '"'; goto backslash; 715 case '\"': c = '\"'; goto backslash;
719 case '\\': c = '\\'; goto backslash; 716 case '\\': c = '\\'; goto backslash;
720 case CTLESC: c = 'e'; goto backslash; 717 case CTLESC: c = 'e'; goto backslash;
721 case CTLVAR: c = 'v'; goto backslash; 718 case CTLVAR: c = 'v'; goto backslash;
722 case CTLVAR+CTLQUOTE: c = 'V'; goto backslash; 719 case CTLVAR+CTLQUOTE: c = 'V'; goto backslash;
723 case CTLBACKQ: c = 'q'; goto backslash; 720 case CTLBACKQ: c = 'q'; goto backslash;
724 case CTLBACKQ+CTLQUOTE: c = 'Q'; goto backslash; 721 case CTLBACKQ+CTLQUOTE: c = 'Q'; goto backslash;
725 backslash: 722 backslash:
726 putc('\\', tracefile); 723 putc('\\', tracefile);
727 putc(c, tracefile); 724 putc(c, tracefile);
@@ -731,8 +728,8 @@ trace_puts_quoted(char *s)
731 putc(*p, tracefile); 728 putc(*p, tracefile);
732 else { 729 else {
733 putc('\\', tracefile); 730 putc('\\', tracefile);
734 putc(*p >> 6 & 03, tracefile); 731 putc((*p >> 6) & 03, tracefile);
735 putc(*p >> 3 & 07, tracefile); 732 putc((*p >> 3) & 07, tracefile);
736 putc(*p & 07, tracefile); 733 putc(*p & 07, tracefile);
737 } 734 }
738 break; 735 break;
@@ -816,7 +813,7 @@ sharg(union node *arg, FILE *fp)
816{ 813{
817 char *p; 814 char *p;
818 struct nodelist *bqlist; 815 struct nodelist *bqlist;
819 int subtype; 816 unsigned char subtype;
820 817
821 if (arg->type != NARG) { 818 if (arg->type != NARG) {
822 out1fmt("<node type %d>\n", arg->type); 819 out1fmt("<node type %d>\n", arg->type);
@@ -824,7 +821,7 @@ sharg(union node *arg, FILE *fp)
824 } 821 }
825 bqlist = arg->narg.backquote; 822 bqlist = arg->narg.backquote;
826 for (p = arg->narg.text; *p; p++) { 823 for (p = arg->narg.text; *p; p++) {
827 switch (*p) { 824 switch ((unsigned char)*p) {
828 case CTLESC: 825 case CTLESC:
829 putc(*++p, fp); 826 putc(*++p, fp);
830 break; 827 break;
@@ -1584,21 +1581,21 @@ single_quote(const char *s)
1584 1581
1585 STADJUST(q - p, p); 1582 STADJUST(q - p, p);
1586 1583
1587 len = strspn(s, "'"); 1584 if (*s != '\'')
1588 if (!len)
1589 break; 1585 break;
1586 len = 0;
1587 do len++; while (*++s == '\'');
1590 1588
1591 q = p = makestrspace(len + 3, p); 1589 q = p = makestrspace(len + 3, p);
1592 1590
1593 *q++ = '"'; 1591 *q++ = '"';
1594 q = (char *)memcpy(q, s, len) + len; 1592 q = (char *)memcpy(q, s - len, len) + len;
1595 *q++ = '"'; 1593 *q++ = '"';
1596 s += len;
1597 1594
1598 STADJUST(q - p, p); 1595 STADJUST(q - p, p);
1599 } while (*s); 1596 } while (*s);
1600 1597
1601 USTPUTC(0, p); 1598 USTPUTC('\0', p);
1602 1599
1603 return stackblock(); 1600 return stackblock();
1604} 1601}
@@ -2606,14 +2603,10 @@ pwdcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
2606#define CIGN 14 /* character should be ignored */ 2603#define CIGN 14 /* character should be ignored */
2607 2604
2608#if ENABLE_ASH_ALIAS 2605#if ENABLE_ASH_ALIAS
2609#define SYNBASE 130 2606# define PEOA 256
2610#define PEOF -130 2607# define PEOF 257
2611#define PEOA -129
2612#define PEOA_OR_PEOF PEOA
2613#else 2608#else
2614#define SYNBASE 129 2609# define PEOF 256
2615#define PEOF -129
2616#define PEOA_OR_PEOF PEOF
2617#endif 2610#endif
2618 2611
2619/* number syntax index */ 2612/* number syntax index */
@@ -2624,14 +2617,14 @@ pwdcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
2624#define PSSYNTAX 4 /* prompt */ 2617#define PSSYNTAX 4 /* prompt */
2625 2618
2626#if ENABLE_ASH_OPTIMIZE_FOR_SIZE 2619#if ENABLE_ASH_OPTIMIZE_FOR_SIZE
2627#define USE_SIT_FUNCTION 2620# define USE_SIT_FUNCTION
2628#endif 2621#endif
2629 2622
2630#if ENABLE_SH_MATH_SUPPORT 2623#if ENABLE_SH_MATH_SUPPORT
2631static const char S_I_T[][4] = { 2624static const uint8_t S_I_T[][4] = {
2632#if ENABLE_ASH_ALIAS 2625# if ENABLE_ASH_ALIAS
2633 { CSPCL, CIGN, CIGN, CIGN }, /* 0, PEOA */ 2626 { CSPCL, CIGN, CIGN, CIGN }, /* 0, PEOA */
2634#endif 2627# endif
2635 { CSPCL, CWORD, CWORD, CWORD }, /* 1, ' ' */ 2628 { CSPCL, CWORD, CWORD, CWORD }, /* 1, ' ' */
2636 { CNL, CNL, CNL, CNL }, /* 2, \n */ 2629 { CNL, CNL, CNL, CNL }, /* 2, \n */
2637 { CWORD, CCTL, CCTL, CWORD }, /* 3, !*-/:=?[]~ */ 2630 { CWORD, CCTL, CCTL, CWORD }, /* 3, !*-/:=?[]~ */
@@ -2643,17 +2636,17 @@ static const char S_I_T[][4] = {
2643 { CBACK, CBACK, CCTL, CBACK }, /* 9, \ */ 2636 { CBACK, CBACK, CCTL, CBACK }, /* 9, \ */
2644 { CBQUOTE, CBQUOTE, CWORD, CBQUOTE }, /* 10, ` */ 2637 { CBQUOTE, CBQUOTE, CWORD, CBQUOTE }, /* 10, ` */
2645 { CENDVAR, CENDVAR, CWORD, CENDVAR }, /* 11, } */ 2638 { CENDVAR, CENDVAR, CWORD, CENDVAR }, /* 11, } */
2646#ifndef USE_SIT_FUNCTION 2639# ifndef USE_SIT_FUNCTION
2647 { CENDFILE, CENDFILE, CENDFILE, CENDFILE }, /* 12, PEOF */ 2640 { CENDFILE, CENDFILE, CENDFILE, CENDFILE }, /* 12, PEOF */
2648 { CWORD, CWORD, CWORD, CWORD }, /* 13, 0-9A-Za-z */ 2641 { CWORD, CWORD, CWORD, CWORD }, /* 13, 0-9A-Za-z */
2649 { CCTL, CCTL, CCTL, CCTL } /* 14, CTLESC ... */ 2642 { CCTL, CCTL, CCTL, CCTL } /* 14, CTLESC ... */
2650#endif 2643# endif
2651}; 2644};
2652#else 2645#else
2653static const char S_I_T[][3] = { 2646static const uint8_t S_I_T[][3] = {
2654#if ENABLE_ASH_ALIAS 2647# if ENABLE_ASH_ALIAS
2655 { CSPCL, CIGN, CIGN }, /* 0, PEOA */ 2648 { CSPCL, CIGN, CIGN }, /* 0, PEOA */
2656#endif 2649# endif
2657 { CSPCL, CWORD, CWORD }, /* 1, ' ' */ 2650 { CSPCL, CWORD, CWORD }, /* 1, ' ' */
2658 { CNL, CNL, CNL }, /* 2, \n */ 2651 { CNL, CNL, CNL }, /* 2, \n */
2659 { CWORD, CCTL, CCTL }, /* 3, !*-/:=?[]~ */ 2652 { CWORD, CCTL, CCTL }, /* 3, !*-/:=?[]~ */
@@ -2665,46 +2658,50 @@ static const char S_I_T[][3] = {
2665 { CBACK, CBACK, CCTL }, /* 9, \ */ 2658 { CBACK, CBACK, CCTL }, /* 9, \ */
2666 { CBQUOTE, CBQUOTE, CWORD }, /* 10, ` */ 2659 { CBQUOTE, CBQUOTE, CWORD }, /* 10, ` */
2667 { CENDVAR, CENDVAR, CWORD }, /* 11, } */ 2660 { CENDVAR, CENDVAR, CWORD }, /* 11, } */
2668#ifndef USE_SIT_FUNCTION 2661# ifndef USE_SIT_FUNCTION
2669 { CENDFILE, CENDFILE, CENDFILE }, /* 12, PEOF */ 2662 { CENDFILE, CENDFILE, CENDFILE }, /* 12, PEOF */
2670 { CWORD, CWORD, CWORD }, /* 13, 0-9A-Za-z */ 2663 { CWORD, CWORD, CWORD }, /* 13, 0-9A-Za-z */
2671 { CCTL, CCTL, CCTL } /* 14, CTLESC ... */ 2664 { CCTL, CCTL, CCTL } /* 14, CTLESC ... */
2672#endif 2665# endif
2673}; 2666};
2674#endif /* SH_MATH_SUPPORT */ 2667#endif /* SH_MATH_SUPPORT */
2675 2668
2669/* c in SIT(c, syntax) must be an *unsigned char* or PEOA or PEOF,
2670 * caller must ensure proper cast on it if c is *char_ptr!
2671 */
2672
2676#ifdef USE_SIT_FUNCTION 2673#ifdef USE_SIT_FUNCTION
2677 2674
2678static int 2675static int
2679SIT(int c, int syntax) 2676SIT(int c, int syntax)
2680{ 2677{
2681 static const char spec_symbls[] ALIGN1 = "\t\n !\"$&'()*-/:;<=>?[\\]`|}~"; 2678 static const char spec_symbls[] ALIGN1 = "\t\n !\"$&'()*-/:;<=>?[\\]`|}~";
2682#if ENABLE_ASH_ALIAS 2679# if ENABLE_ASH_ALIAS
2683 static const char syntax_index_table[] ALIGN1 = { 2680 static const uint8_t syntax_index_table[] ALIGN1 = {
2684 1, 2, 1, 3, 4, 5, 1, 6, /* "\t\n !\"$&'" */ 2681 1, 2, 1, 3, 4, 5, 1, 6, /* "\t\n !\"$&'" */
2685 7, 8, 3, 3, 3, 3, 1, 1, /* "()*-/:;<" */ 2682 7, 8, 3, 3, 3, 3, 1, 1, /* "()*-/:;<" */
2686 3, 1, 3, 3, 9, 3, 10, 1, /* "=>?[\\]`|" */ 2683 3, 1, 3, 3, 9, 3, 10, 1, /* "=>?[\\]`|" */
2687 11, 3 /* "}~" */ 2684 11, 3 /* "}~" */
2688 }; 2685 };
2689#else 2686# else
2690 static const char syntax_index_table[] ALIGN1 = { 2687 static const uint8_t syntax_index_table[] ALIGN1 = {
2691 0, 1, 0, 2, 3, 4, 0, 5, /* "\t\n !\"$&'" */ 2688 0, 1, 0, 2, 3, 4, 0, 5, /* "\t\n !\"$&'" */
2692 6, 7, 2, 2, 2, 2, 0, 0, /* "()*-/:;<" */ 2689 6, 7, 2, 2, 2, 2, 0, 0, /* "()*-/:;<" */
2693 2, 0, 2, 2, 8, 2, 9, 0, /* "=>?[\\]`|" */ 2690 2, 0, 2, 2, 8, 2, 9, 0, /* "=>?[\\]`|" */
2694 10, 2 /* "}~" */ 2691 10, 2 /* "}~" */
2695 }; 2692 };
2696#endif 2693# endif
2697 const char *s; 2694 const char *s;
2698 int indx; 2695 int indx;
2699 2696
2700 if (c == PEOF) { /* 2^8+2 */ 2697 if (c == PEOF) { /* 2^8+2 */
2701 return CENDFILE; 2698 return CENDFILE;
2702 } 2699 }
2703#if ENABLE_ASH_ALIAS 2700# if ENABLE_ASH_ALIAS
2704 if (c == PEOA) { /* 2^8+1 */ 2701 if (c == PEOA) { /* 2^8+1 */
2705 indx = 0; 2702 indx = 0;
2706 } else 2703 } else
2707#endif 2704# endif
2708 { 2705 {
2709 if ((unsigned char)c >= CTLESC 2706 if ((unsigned char)c >= CTLESC
2710 && (unsigned char)c <= CTLQUOTEMARK 2707 && (unsigned char)c <= CTLQUOTEMARK
@@ -2722,304 +2719,304 @@ SIT(int c, int syntax)
2722 2719
2723#else /* !USE_SIT_FUNCTION */ 2720#else /* !USE_SIT_FUNCTION */
2724 2721
2725#if ENABLE_ASH_ALIAS 2722# if ENABLE_ASH_ALIAS
2726#define CSPCL_CIGN_CIGN_CIGN 0 2723# define CSPCL_CIGN_CIGN_CIGN 0
2727#define CSPCL_CWORD_CWORD_CWORD 1 2724# define CSPCL_CWORD_CWORD_CWORD 1
2728#define CNL_CNL_CNL_CNL 2 2725# define CNL_CNL_CNL_CNL 2
2729#define CWORD_CCTL_CCTL_CWORD 3 2726# define CWORD_CCTL_CCTL_CWORD 3
2730#define CDQUOTE_CENDQUOTE_CWORD_CWORD 4 2727# define CDQUOTE_CENDQUOTE_CWORD_CWORD 4
2731#define CVAR_CVAR_CWORD_CVAR 5 2728# define CVAR_CVAR_CWORD_CVAR 5
2732#define CSQUOTE_CWORD_CENDQUOTE_CWORD 6 2729# define CSQUOTE_CWORD_CENDQUOTE_CWORD 6
2733#define CSPCL_CWORD_CWORD_CLP 7 2730# define CSPCL_CWORD_CWORD_CLP 7
2734#define CSPCL_CWORD_CWORD_CRP 8 2731# define CSPCL_CWORD_CWORD_CRP 8
2735#define CBACK_CBACK_CCTL_CBACK 9 2732# define CBACK_CBACK_CCTL_CBACK 9
2736#define CBQUOTE_CBQUOTE_CWORD_CBQUOTE 10 2733# define CBQUOTE_CBQUOTE_CWORD_CBQUOTE 10
2737#define CENDVAR_CENDVAR_CWORD_CENDVAR 11 2734# define CENDVAR_CENDVAR_CWORD_CENDVAR 11
2738#define CENDFILE_CENDFILE_CENDFILE_CENDFILE 12 2735# define CENDFILE_CENDFILE_CENDFILE_CENDFILE 12
2739#define CWORD_CWORD_CWORD_CWORD 13 2736# define CWORD_CWORD_CWORD_CWORD 13
2740#define CCTL_CCTL_CCTL_CCTL 14 2737# define CCTL_CCTL_CCTL_CCTL 14
2741#else 2738# else
2742#define CSPCL_CWORD_CWORD_CWORD 0 2739# define CSPCL_CWORD_CWORD_CWORD 0
2743#define CNL_CNL_CNL_CNL 1 2740# define CNL_CNL_CNL_CNL 1
2744#define CWORD_CCTL_CCTL_CWORD 2 2741# define CWORD_CCTL_CCTL_CWORD 2
2745#define CDQUOTE_CENDQUOTE_CWORD_CWORD 3 2742# define CDQUOTE_CENDQUOTE_CWORD_CWORD 3
2746#define CVAR_CVAR_CWORD_CVAR 4 2743# define CVAR_CVAR_CWORD_CVAR 4
2747#define CSQUOTE_CWORD_CENDQUOTE_CWORD 5 2744# define CSQUOTE_CWORD_CENDQUOTE_CWORD 5
2748#define CSPCL_CWORD_CWORD_CLP 6 2745# define CSPCL_CWORD_CWORD_CLP 6
2749#define CSPCL_CWORD_CWORD_CRP 7 2746# define CSPCL_CWORD_CWORD_CRP 7
2750#define CBACK_CBACK_CCTL_CBACK 8 2747# define CBACK_CBACK_CCTL_CBACK 8
2751#define CBQUOTE_CBQUOTE_CWORD_CBQUOTE 9 2748# define CBQUOTE_CBQUOTE_CWORD_CBQUOTE 9
2752#define CENDVAR_CENDVAR_CWORD_CENDVAR 10 2749# define CENDVAR_CENDVAR_CWORD_CENDVAR 10
2753#define CENDFILE_CENDFILE_CENDFILE_CENDFILE 11 2750# define CENDFILE_CENDFILE_CENDFILE_CENDFILE 11
2754#define CWORD_CWORD_CWORD_CWORD 12 2751# define CWORD_CWORD_CWORD_CWORD 12
2755#define CCTL_CCTL_CCTL_CCTL 13 2752# define CCTL_CCTL_CCTL_CCTL 13
2756#endif 2753# endif
2757 2754
2758static const char syntax_index_table[258] = { 2755static const uint8_t syntax_index_table[258] = {
2759 /* BASESYNTAX_DQSYNTAX_SQSYNTAX_ARISYNTAX */ 2756 /* BASESYNTAX_DQSYNTAX_SQSYNTAX_ARISYNTAX */
2760 /* 0 PEOF */ CENDFILE_CENDFILE_CENDFILE_CENDFILE, 2757 /* 0 */ CWORD_CWORD_CWORD_CWORD,
2761#if ENABLE_ASH_ALIAS 2758 /* 1 */ CWORD_CWORD_CWORD_CWORD,
2762 /* 1 PEOA */ CSPCL_CIGN_CIGN_CIGN, 2759 /* 2 */ CWORD_CWORD_CWORD_CWORD,
2763#endif 2760 /* 3 */ CWORD_CWORD_CWORD_CWORD,
2764 /* 2 -128 0x80 */ CWORD_CWORD_CWORD_CWORD, 2761 /* 4 */ CWORD_CWORD_CWORD_CWORD,
2765 /* 3 -127 CTLESC */ CCTL_CCTL_CCTL_CCTL, 2762 /* 5 */ CWORD_CWORD_CWORD_CWORD,
2766 /* 4 -126 CTLVAR */ CCTL_CCTL_CCTL_CCTL, 2763 /* 6 */ CWORD_CWORD_CWORD_CWORD,
2767 /* 5 -125 CTLENDVAR */ CCTL_CCTL_CCTL_CCTL, 2764 /* 7 */ CWORD_CWORD_CWORD_CWORD,
2768 /* 6 -124 CTLBACKQ */ CCTL_CCTL_CCTL_CCTL, 2765 /* 8 */ CWORD_CWORD_CWORD_CWORD,
2769 /* 7 -123 CTLQUOTE */ CCTL_CCTL_CCTL_CCTL, 2766 /* 9 "\t" */ CSPCL_CWORD_CWORD_CWORD,
2770 /* 8 -122 CTLARI */ CCTL_CCTL_CCTL_CCTL, 2767 /* 10 "\n" */ CNL_CNL_CNL_CNL,
2771 /* 9 -121 CTLENDARI */ CCTL_CCTL_CCTL_CCTL, 2768 /* 11 */ CWORD_CWORD_CWORD_CWORD,
2772 /* 10 -120 CTLQUOTEMARK */ CCTL_CCTL_CCTL_CCTL, 2769 /* 12 */ CWORD_CWORD_CWORD_CWORD,
2773 /* 11 -119 */ CWORD_CWORD_CWORD_CWORD, 2770 /* 13 */ CWORD_CWORD_CWORD_CWORD,
2774 /* 12 -118 */ CWORD_CWORD_CWORD_CWORD, 2771 /* 14 */ CWORD_CWORD_CWORD_CWORD,
2775 /* 13 -117 */ CWORD_CWORD_CWORD_CWORD, 2772 /* 15 */ CWORD_CWORD_CWORD_CWORD,
2776 /* 14 -116 */ CWORD_CWORD_CWORD_CWORD, 2773 /* 16 */ CWORD_CWORD_CWORD_CWORD,
2777 /* 15 -115 */ CWORD_CWORD_CWORD_CWORD, 2774 /* 17 */ CWORD_CWORD_CWORD_CWORD,
2778 /* 16 -114 */ CWORD_CWORD_CWORD_CWORD, 2775 /* 18 */ CWORD_CWORD_CWORD_CWORD,
2779 /* 17 -113 */ CWORD_CWORD_CWORD_CWORD, 2776 /* 19 */ CWORD_CWORD_CWORD_CWORD,
2780 /* 18 -112 */ CWORD_CWORD_CWORD_CWORD, 2777 /* 20 */ CWORD_CWORD_CWORD_CWORD,
2781 /* 19 -111 */ CWORD_CWORD_CWORD_CWORD, 2778 /* 21 */ CWORD_CWORD_CWORD_CWORD,
2782 /* 20 -110 */ CWORD_CWORD_CWORD_CWORD, 2779 /* 22 */ CWORD_CWORD_CWORD_CWORD,
2783 /* 21 -109 */ CWORD_CWORD_CWORD_CWORD, 2780 /* 23 */ CWORD_CWORD_CWORD_CWORD,
2784 /* 22 -108 */ CWORD_CWORD_CWORD_CWORD, 2781 /* 24 */ CWORD_CWORD_CWORD_CWORD,
2785 /* 23 -107 */ CWORD_CWORD_CWORD_CWORD, 2782 /* 25 */ CWORD_CWORD_CWORD_CWORD,
2786 /* 24 -106 */ CWORD_CWORD_CWORD_CWORD, 2783 /* 26 */ CWORD_CWORD_CWORD_CWORD,
2787 /* 25 -105 */ CWORD_CWORD_CWORD_CWORD, 2784 /* 27 */ CWORD_CWORD_CWORD_CWORD,
2788 /* 26 -104 */ CWORD_CWORD_CWORD_CWORD, 2785 /* 28 */ CWORD_CWORD_CWORD_CWORD,
2789 /* 27 -103 */ CWORD_CWORD_CWORD_CWORD, 2786 /* 29 */ CWORD_CWORD_CWORD_CWORD,
2790 /* 28 -102 */ CWORD_CWORD_CWORD_CWORD, 2787 /* 30 */ CWORD_CWORD_CWORD_CWORD,
2791 /* 29 -101 */ CWORD_CWORD_CWORD_CWORD, 2788 /* 31 */ CWORD_CWORD_CWORD_CWORD,
2792 /* 30 -100 */ CWORD_CWORD_CWORD_CWORD, 2789 /* 32 " " */ CSPCL_CWORD_CWORD_CWORD,
2793 /* 31 -99 */ CWORD_CWORD_CWORD_CWORD, 2790 /* 33 "!" */ CWORD_CCTL_CCTL_CWORD,
2794 /* 32 -98 */ CWORD_CWORD_CWORD_CWORD, 2791 /* 34 """ */ CDQUOTE_CENDQUOTE_CWORD_CWORD,
2795 /* 33 -97 */ CWORD_CWORD_CWORD_CWORD, 2792 /* 35 "#" */ CWORD_CWORD_CWORD_CWORD,
2796 /* 34 -96 */ CWORD_CWORD_CWORD_CWORD, 2793 /* 36 "$" */ CVAR_CVAR_CWORD_CVAR,
2797 /* 35 -95 */ CWORD_CWORD_CWORD_CWORD, 2794 /* 37 "%" */ CWORD_CWORD_CWORD_CWORD,
2798 /* 36 -94 */ CWORD_CWORD_CWORD_CWORD, 2795 /* 38 "&" */ CSPCL_CWORD_CWORD_CWORD,
2799 /* 37 -93 */ CWORD_CWORD_CWORD_CWORD, 2796 /* 39 "'" */ CSQUOTE_CWORD_CENDQUOTE_CWORD,
2800 /* 38 -92 */ CWORD_CWORD_CWORD_CWORD, 2797 /* 40 "(" */ CSPCL_CWORD_CWORD_CLP,
2801 /* 39 -91 */ CWORD_CWORD_CWORD_CWORD, 2798 /* 41 ")" */ CSPCL_CWORD_CWORD_CRP,
2802 /* 40 -90 */ CWORD_CWORD_CWORD_CWORD, 2799 /* 42 "*" */ CWORD_CCTL_CCTL_CWORD,
2803 /* 41 -89 */ CWORD_CWORD_CWORD_CWORD, 2800 /* 43 "+" */ CWORD_CWORD_CWORD_CWORD,
2804 /* 42 -88 */ CWORD_CWORD_CWORD_CWORD, 2801 /* 44 "," */ CWORD_CWORD_CWORD_CWORD,
2805 /* 43 -87 */ CWORD_CWORD_CWORD_CWORD, 2802 /* 45 "-" */ CWORD_CCTL_CCTL_CWORD,
2806 /* 44 -86 */ CWORD_CWORD_CWORD_CWORD, 2803 /* 46 "." */ CWORD_CWORD_CWORD_CWORD,
2807 /* 45 -85 */ CWORD_CWORD_CWORD_CWORD, 2804 /* 47 "/" */ CWORD_CCTL_CCTL_CWORD,
2808 /* 46 -84 */ CWORD_CWORD_CWORD_CWORD, 2805 /* 48 "0" */ CWORD_CWORD_CWORD_CWORD,
2809 /* 47 -83 */ CWORD_CWORD_CWORD_CWORD, 2806 /* 49 "1" */ CWORD_CWORD_CWORD_CWORD,
2810 /* 48 -82 */ CWORD_CWORD_CWORD_CWORD, 2807 /* 50 "2" */ CWORD_CWORD_CWORD_CWORD,
2811 /* 49 -81 */ CWORD_CWORD_CWORD_CWORD, 2808 /* 51 "3" */ CWORD_CWORD_CWORD_CWORD,
2812 /* 50 -80 */ CWORD_CWORD_CWORD_CWORD, 2809 /* 52 "4" */ CWORD_CWORD_CWORD_CWORD,
2813 /* 51 -79 */ CWORD_CWORD_CWORD_CWORD, 2810 /* 53 "5" */ CWORD_CWORD_CWORD_CWORD,
2814 /* 52 -78 */ CWORD_CWORD_CWORD_CWORD, 2811 /* 54 "6" */ CWORD_CWORD_CWORD_CWORD,
2815 /* 53 -77 */ CWORD_CWORD_CWORD_CWORD, 2812 /* 55 "7" */ CWORD_CWORD_CWORD_CWORD,
2816 /* 54 -76 */ CWORD_CWORD_CWORD_CWORD, 2813 /* 56 "8" */ CWORD_CWORD_CWORD_CWORD,
2817 /* 55 -75 */ CWORD_CWORD_CWORD_CWORD, 2814 /* 57 "9" */ CWORD_CWORD_CWORD_CWORD,
2818 /* 56 -74 */ CWORD_CWORD_CWORD_CWORD, 2815 /* 58 ":" */ CWORD_CCTL_CCTL_CWORD,
2819 /* 57 -73 */ CWORD_CWORD_CWORD_CWORD, 2816 /* 59 ";" */ CSPCL_CWORD_CWORD_CWORD,
2820 /* 58 -72 */ CWORD_CWORD_CWORD_CWORD, 2817 /* 60 "<" */ CSPCL_CWORD_CWORD_CWORD,
2821 /* 59 -71 */ CWORD_CWORD_CWORD_CWORD, 2818 /* 61 "=" */ CWORD_CCTL_CCTL_CWORD,
2822 /* 60 -70 */ CWORD_CWORD_CWORD_CWORD, 2819 /* 62 ">" */ CSPCL_CWORD_CWORD_CWORD,
2823 /* 61 -69 */ CWORD_CWORD_CWORD_CWORD, 2820 /* 63 "?" */ CWORD_CCTL_CCTL_CWORD,
2824 /* 62 -68 */ CWORD_CWORD_CWORD_CWORD, 2821 /* 64 "@" */ CWORD_CWORD_CWORD_CWORD,
2825 /* 63 -67 */ CWORD_CWORD_CWORD_CWORD, 2822 /* 65 "A" */ CWORD_CWORD_CWORD_CWORD,
2826 /* 64 -66 */ CWORD_CWORD_CWORD_CWORD, 2823 /* 66 "B" */ CWORD_CWORD_CWORD_CWORD,
2827 /* 65 -65 */ CWORD_CWORD_CWORD_CWORD, 2824 /* 67 "C" */ CWORD_CWORD_CWORD_CWORD,
2828 /* 66 -64 */ CWORD_CWORD_CWORD_CWORD, 2825 /* 68 "D" */ CWORD_CWORD_CWORD_CWORD,
2829 /* 67 -63 */ CWORD_CWORD_CWORD_CWORD, 2826 /* 69 "E" */ CWORD_CWORD_CWORD_CWORD,
2830 /* 68 -62 */ CWORD_CWORD_CWORD_CWORD, 2827 /* 70 "F" */ CWORD_CWORD_CWORD_CWORD,
2831 /* 69 -61 */ CWORD_CWORD_CWORD_CWORD, 2828 /* 71 "G" */ CWORD_CWORD_CWORD_CWORD,
2832 /* 70 -60 */ CWORD_CWORD_CWORD_CWORD, 2829 /* 72 "H" */ CWORD_CWORD_CWORD_CWORD,
2833 /* 71 -59 */ CWORD_CWORD_CWORD_CWORD, 2830 /* 73 "I" */ CWORD_CWORD_CWORD_CWORD,
2834 /* 72 -58 */ CWORD_CWORD_CWORD_CWORD, 2831 /* 74 "J" */ CWORD_CWORD_CWORD_CWORD,
2835 /* 73 -57 */ CWORD_CWORD_CWORD_CWORD, 2832 /* 75 "K" */ CWORD_CWORD_CWORD_CWORD,
2836 /* 74 -56 */ CWORD_CWORD_CWORD_CWORD, 2833 /* 76 "L" */ CWORD_CWORD_CWORD_CWORD,
2837 /* 75 -55 */ CWORD_CWORD_CWORD_CWORD, 2834 /* 77 "M" */ CWORD_CWORD_CWORD_CWORD,
2838 /* 76 -54 */ CWORD_CWORD_CWORD_CWORD, 2835 /* 78 "N" */ CWORD_CWORD_CWORD_CWORD,
2839 /* 77 -53 */ CWORD_CWORD_CWORD_CWORD, 2836 /* 79 "O" */ CWORD_CWORD_CWORD_CWORD,
2840 /* 78 -52 */ CWORD_CWORD_CWORD_CWORD, 2837 /* 80 "P" */ CWORD_CWORD_CWORD_CWORD,
2841 /* 79 -51 */ CWORD_CWORD_CWORD_CWORD, 2838 /* 81 "Q" */ CWORD_CWORD_CWORD_CWORD,
2842 /* 80 -50 */ CWORD_CWORD_CWORD_CWORD, 2839 /* 82 "R" */ CWORD_CWORD_CWORD_CWORD,
2843 /* 81 -49 */ CWORD_CWORD_CWORD_CWORD, 2840 /* 83 "S" */ CWORD_CWORD_CWORD_CWORD,
2844 /* 82 -48 */ CWORD_CWORD_CWORD_CWORD, 2841 /* 84 "T" */ CWORD_CWORD_CWORD_CWORD,
2845 /* 83 -47 */ CWORD_CWORD_CWORD_CWORD, 2842 /* 85 "U" */ CWORD_CWORD_CWORD_CWORD,
2846 /* 84 -46 */ CWORD_CWORD_CWORD_CWORD, 2843 /* 86 "V" */ CWORD_CWORD_CWORD_CWORD,
2847 /* 85 -45 */ CWORD_CWORD_CWORD_CWORD, 2844 /* 87 "W" */ CWORD_CWORD_CWORD_CWORD,
2848 /* 86 -44 */ CWORD_CWORD_CWORD_CWORD, 2845 /* 88 "X" */ CWORD_CWORD_CWORD_CWORD,
2849 /* 87 -43 */ CWORD_CWORD_CWORD_CWORD, 2846 /* 89 "Y" */ CWORD_CWORD_CWORD_CWORD,
2850 /* 88 -42 */ CWORD_CWORD_CWORD_CWORD, 2847 /* 90 "Z" */ CWORD_CWORD_CWORD_CWORD,
2851 /* 89 -41 */ CWORD_CWORD_CWORD_CWORD, 2848 /* 91 "[" */ CWORD_CCTL_CCTL_CWORD,
2852 /* 90 -40 */ CWORD_CWORD_CWORD_CWORD, 2849 /* 92 "\" */ CBACK_CBACK_CCTL_CBACK,
2853 /* 91 -39 */ CWORD_CWORD_CWORD_CWORD, 2850 /* 93 "]" */ CWORD_CCTL_CCTL_CWORD,
2854 /* 92 -38 */ CWORD_CWORD_CWORD_CWORD, 2851 /* 94 "^" */ CWORD_CWORD_CWORD_CWORD,
2855 /* 93 -37 */ CWORD_CWORD_CWORD_CWORD, 2852 /* 95 "_" */ CWORD_CWORD_CWORD_CWORD,
2856 /* 94 -36 */ CWORD_CWORD_CWORD_CWORD, 2853 /* 96 "`" */ CBQUOTE_CBQUOTE_CWORD_CBQUOTE,
2857 /* 95 -35 */ CWORD_CWORD_CWORD_CWORD, 2854 /* 97 "a" */ CWORD_CWORD_CWORD_CWORD,
2858 /* 96 -34 */ CWORD_CWORD_CWORD_CWORD, 2855 /* 98 "b" */ CWORD_CWORD_CWORD_CWORD,
2859 /* 97 -33 */ CWORD_CWORD_CWORD_CWORD, 2856 /* 99 "c" */ CWORD_CWORD_CWORD_CWORD,
2860 /* 98 -32 */ CWORD_CWORD_CWORD_CWORD, 2857 /* 100 "d" */ CWORD_CWORD_CWORD_CWORD,
2861 /* 99 -31 */ CWORD_CWORD_CWORD_CWORD, 2858 /* 101 "e" */ CWORD_CWORD_CWORD_CWORD,
2862 /* 100 -30 */ CWORD_CWORD_CWORD_CWORD, 2859 /* 102 "f" */ CWORD_CWORD_CWORD_CWORD,
2863 /* 101 -29 */ CWORD_CWORD_CWORD_CWORD, 2860 /* 103 "g" */ CWORD_CWORD_CWORD_CWORD,
2864 /* 102 -28 */ CWORD_CWORD_CWORD_CWORD, 2861 /* 104 "h" */ CWORD_CWORD_CWORD_CWORD,
2865 /* 103 -27 */ CWORD_CWORD_CWORD_CWORD, 2862 /* 105 "i" */ CWORD_CWORD_CWORD_CWORD,
2866 /* 104 -26 */ CWORD_CWORD_CWORD_CWORD, 2863 /* 106 "j" */ CWORD_CWORD_CWORD_CWORD,
2867 /* 105 -25 */ CWORD_CWORD_CWORD_CWORD, 2864 /* 107 "k" */ CWORD_CWORD_CWORD_CWORD,
2868 /* 106 -24 */ CWORD_CWORD_CWORD_CWORD, 2865 /* 108 "l" */ CWORD_CWORD_CWORD_CWORD,
2869 /* 107 -23 */ CWORD_CWORD_CWORD_CWORD, 2866 /* 109 "m" */ CWORD_CWORD_CWORD_CWORD,
2870 /* 108 -22 */ CWORD_CWORD_CWORD_CWORD, 2867 /* 110 "n" */ CWORD_CWORD_CWORD_CWORD,
2871 /* 109 -21 */ CWORD_CWORD_CWORD_CWORD, 2868 /* 111 "o" */ CWORD_CWORD_CWORD_CWORD,
2872 /* 110 -20 */ CWORD_CWORD_CWORD_CWORD, 2869 /* 112 "p" */ CWORD_CWORD_CWORD_CWORD,
2873 /* 111 -19 */ CWORD_CWORD_CWORD_CWORD, 2870 /* 113 "q" */ CWORD_CWORD_CWORD_CWORD,
2874 /* 112 -18 */ CWORD_CWORD_CWORD_CWORD, 2871 /* 114 "r" */ CWORD_CWORD_CWORD_CWORD,
2875 /* 113 -17 */ CWORD_CWORD_CWORD_CWORD, 2872 /* 115 "s" */ CWORD_CWORD_CWORD_CWORD,
2876 /* 114 -16 */ CWORD_CWORD_CWORD_CWORD, 2873 /* 116 "t" */ CWORD_CWORD_CWORD_CWORD,
2877 /* 115 -15 */ CWORD_CWORD_CWORD_CWORD, 2874 /* 117 "u" */ CWORD_CWORD_CWORD_CWORD,
2878 /* 116 -14 */ CWORD_CWORD_CWORD_CWORD, 2875 /* 118 "v" */ CWORD_CWORD_CWORD_CWORD,
2879 /* 117 -13 */ CWORD_CWORD_CWORD_CWORD, 2876 /* 119 "w" */ CWORD_CWORD_CWORD_CWORD,
2880 /* 118 -12 */ CWORD_CWORD_CWORD_CWORD, 2877 /* 120 "x" */ CWORD_CWORD_CWORD_CWORD,
2881 /* 119 -11 */ CWORD_CWORD_CWORD_CWORD, 2878 /* 121 "y" */ CWORD_CWORD_CWORD_CWORD,
2882 /* 120 -10 */ CWORD_CWORD_CWORD_CWORD, 2879 /* 122 "z" */ CWORD_CWORD_CWORD_CWORD,
2883 /* 121 -9 */ CWORD_CWORD_CWORD_CWORD, 2880 /* 123 "{" */ CWORD_CWORD_CWORD_CWORD,
2884 /* 122 -8 */ CWORD_CWORD_CWORD_CWORD, 2881 /* 124 "|" */ CSPCL_CWORD_CWORD_CWORD,
2885 /* 123 -7 */ CWORD_CWORD_CWORD_CWORD, 2882 /* 125 "}" */ CENDVAR_CENDVAR_CWORD_CENDVAR,
2886 /* 124 -6 */ CWORD_CWORD_CWORD_CWORD, 2883 /* 126 "~" */ CWORD_CCTL_CCTL_CWORD,
2887 /* 125 -5 */ CWORD_CWORD_CWORD_CWORD, 2884 /* 127 del */ CWORD_CWORD_CWORD_CWORD,
2888 /* 126 -4 */ CWORD_CWORD_CWORD_CWORD, 2885 /* 128 0x80 */ CWORD_CWORD_CWORD_CWORD,
2889 /* 127 -3 */ CWORD_CWORD_CWORD_CWORD, 2886 /* 129 CTLESC */ CCTL_CCTL_CCTL_CCTL,
2890 /* 128 -2 */ CWORD_CWORD_CWORD_CWORD, 2887 /* 130 CTLVAR */ CCTL_CCTL_CCTL_CCTL,
2891 /* 129 -1 */ CWORD_CWORD_CWORD_CWORD, 2888 /* 131 CTLENDVAR */ CCTL_CCTL_CCTL_CCTL,
2892 /* 130 0 */ CWORD_CWORD_CWORD_CWORD, 2889 /* 132 CTLBACKQ */ CCTL_CCTL_CCTL_CCTL,
2893 /* 131 1 */ CWORD_CWORD_CWORD_CWORD, 2890 /* 133 CTLQUOTE */ CCTL_CCTL_CCTL_CCTL,
2894 /* 132 2 */ CWORD_CWORD_CWORD_CWORD, 2891 /* 134 CTLARI */ CCTL_CCTL_CCTL_CCTL,
2895 /* 133 3 */ CWORD_CWORD_CWORD_CWORD, 2892 /* 135 CTLENDARI */ CCTL_CCTL_CCTL_CCTL,
2896 /* 134 4 */ CWORD_CWORD_CWORD_CWORD, 2893 /* 136 CTLQUOTEMARK */ CCTL_CCTL_CCTL_CCTL,
2897 /* 135 5 */ CWORD_CWORD_CWORD_CWORD, 2894 /* 137 */ CWORD_CWORD_CWORD_CWORD,
2898 /* 136 6 */ CWORD_CWORD_CWORD_CWORD, 2895 /* 138 */ CWORD_CWORD_CWORD_CWORD,
2899 /* 137 7 */ CWORD_CWORD_CWORD_CWORD, 2896 /* 139 */ CWORD_CWORD_CWORD_CWORD,
2900 /* 138 8 */ CWORD_CWORD_CWORD_CWORD, 2897 /* 140 */ CWORD_CWORD_CWORD_CWORD,
2901 /* 139 9 "\t" */ CSPCL_CWORD_CWORD_CWORD, 2898 /* 141 */ CWORD_CWORD_CWORD_CWORD,
2902 /* 140 10 "\n" */ CNL_CNL_CNL_CNL, 2899 /* 142 */ CWORD_CWORD_CWORD_CWORD,
2903 /* 141 11 */ CWORD_CWORD_CWORD_CWORD, 2900 /* 143 */ CWORD_CWORD_CWORD_CWORD,
2904 /* 142 12 */ CWORD_CWORD_CWORD_CWORD, 2901 /* 144 */ CWORD_CWORD_CWORD_CWORD,
2905 /* 143 13 */ CWORD_CWORD_CWORD_CWORD, 2902 /* 145 */ CWORD_CWORD_CWORD_CWORD,
2906 /* 144 14 */ CWORD_CWORD_CWORD_CWORD, 2903 /* 146 */ CWORD_CWORD_CWORD_CWORD,
2907 /* 145 15 */ CWORD_CWORD_CWORD_CWORD, 2904 /* 147 */ CWORD_CWORD_CWORD_CWORD,
2908 /* 146 16 */ CWORD_CWORD_CWORD_CWORD, 2905 /* 148 */ CWORD_CWORD_CWORD_CWORD,
2909 /* 147 17 */ CWORD_CWORD_CWORD_CWORD, 2906 /* 149 */ CWORD_CWORD_CWORD_CWORD,
2910 /* 148 18 */ CWORD_CWORD_CWORD_CWORD, 2907 /* 150 */ CWORD_CWORD_CWORD_CWORD,
2911 /* 149 19 */ CWORD_CWORD_CWORD_CWORD, 2908 /* 151 */ CWORD_CWORD_CWORD_CWORD,
2912 /* 150 20 */ CWORD_CWORD_CWORD_CWORD, 2909 /* 152 */ CWORD_CWORD_CWORD_CWORD,
2913 /* 151 21 */ CWORD_CWORD_CWORD_CWORD, 2910 /* 153 */ CWORD_CWORD_CWORD_CWORD,
2914 /* 152 22 */ CWORD_CWORD_CWORD_CWORD, 2911 /* 154 */ CWORD_CWORD_CWORD_CWORD,
2915 /* 153 23 */ CWORD_CWORD_CWORD_CWORD, 2912 /* 155 */ CWORD_CWORD_CWORD_CWORD,
2916 /* 154 24 */ CWORD_CWORD_CWORD_CWORD, 2913 /* 156 */ CWORD_CWORD_CWORD_CWORD,
2917 /* 155 25 */ CWORD_CWORD_CWORD_CWORD, 2914 /* 157 */ CWORD_CWORD_CWORD_CWORD,
2918 /* 156 26 */ CWORD_CWORD_CWORD_CWORD, 2915 /* 158 */ CWORD_CWORD_CWORD_CWORD,
2919 /* 157 27 */ CWORD_CWORD_CWORD_CWORD, 2916 /* 159 */ CWORD_CWORD_CWORD_CWORD,
2920 /* 158 28 */ CWORD_CWORD_CWORD_CWORD, 2917 /* 160 */ CWORD_CWORD_CWORD_CWORD,
2921 /* 159 29 */ CWORD_CWORD_CWORD_CWORD, 2918 /* 161 */ CWORD_CWORD_CWORD_CWORD,
2922 /* 160 30 */ CWORD_CWORD_CWORD_CWORD, 2919 /* 162 */ CWORD_CWORD_CWORD_CWORD,
2923 /* 161 31 */ CWORD_CWORD_CWORD_CWORD, 2920 /* 163 */ CWORD_CWORD_CWORD_CWORD,
2924 /* 162 32 " " */ CSPCL_CWORD_CWORD_CWORD, 2921 /* 164 */ CWORD_CWORD_CWORD_CWORD,
2925 /* 163 33 "!" */ CWORD_CCTL_CCTL_CWORD, 2922 /* 165 */ CWORD_CWORD_CWORD_CWORD,
2926 /* 164 34 """ */ CDQUOTE_CENDQUOTE_CWORD_CWORD, 2923 /* 166 */ CWORD_CWORD_CWORD_CWORD,
2927 /* 165 35 "#" */ CWORD_CWORD_CWORD_CWORD, 2924 /* 167 */ CWORD_CWORD_CWORD_CWORD,
2928 /* 166 36 "$" */ CVAR_CVAR_CWORD_CVAR, 2925 /* 168 */ CWORD_CWORD_CWORD_CWORD,
2929 /* 167 37 "%" */ CWORD_CWORD_CWORD_CWORD, 2926 /* 169 */ CWORD_CWORD_CWORD_CWORD,
2930 /* 168 38 "&" */ CSPCL_CWORD_CWORD_CWORD, 2927 /* 170 */ CWORD_CWORD_CWORD_CWORD,
2931 /* 169 39 "'" */ CSQUOTE_CWORD_CENDQUOTE_CWORD, 2928 /* 171 */ CWORD_CWORD_CWORD_CWORD,
2932 /* 170 40 "(" */ CSPCL_CWORD_CWORD_CLP, 2929 /* 172 */ CWORD_CWORD_CWORD_CWORD,
2933 /* 171 41 ")" */ CSPCL_CWORD_CWORD_CRP, 2930 /* 173 */ CWORD_CWORD_CWORD_CWORD,
2934 /* 172 42 "*" */ CWORD_CCTL_CCTL_CWORD, 2931 /* 174 */ CWORD_CWORD_CWORD_CWORD,
2935 /* 173 43 "+" */ CWORD_CWORD_CWORD_CWORD, 2932 /* 175 */ CWORD_CWORD_CWORD_CWORD,
2936 /* 174 44 "," */ CWORD_CWORD_CWORD_CWORD, 2933 /* 176 */ CWORD_CWORD_CWORD_CWORD,
2937 /* 175 45 "-" */ CWORD_CCTL_CCTL_CWORD, 2934 /* 177 */ CWORD_CWORD_CWORD_CWORD,
2938 /* 176 46 "." */ CWORD_CWORD_CWORD_CWORD, 2935 /* 178 */ CWORD_CWORD_CWORD_CWORD,
2939 /* 177 47 "/" */ CWORD_CCTL_CCTL_CWORD, 2936 /* 179 */ CWORD_CWORD_CWORD_CWORD,
2940 /* 178 48 "0" */ CWORD_CWORD_CWORD_CWORD, 2937 /* 180 */ CWORD_CWORD_CWORD_CWORD,
2941 /* 179 49 "1" */ CWORD_CWORD_CWORD_CWORD, 2938 /* 181 */ CWORD_CWORD_CWORD_CWORD,
2942 /* 180 50 "2" */ CWORD_CWORD_CWORD_CWORD, 2939 /* 182 */ CWORD_CWORD_CWORD_CWORD,
2943 /* 181 51 "3" */ CWORD_CWORD_CWORD_CWORD, 2940 /* 183 */ CWORD_CWORD_CWORD_CWORD,
2944 /* 182 52 "4" */ CWORD_CWORD_CWORD_CWORD, 2941 /* 184 */ CWORD_CWORD_CWORD_CWORD,
2945 /* 183 53 "5" */ CWORD_CWORD_CWORD_CWORD, 2942 /* 185 */ CWORD_CWORD_CWORD_CWORD,
2946 /* 184 54 "6" */ CWORD_CWORD_CWORD_CWORD, 2943 /* 186 */ CWORD_CWORD_CWORD_CWORD,
2947 /* 185 55 "7" */ CWORD_CWORD_CWORD_CWORD, 2944 /* 187 */ CWORD_CWORD_CWORD_CWORD,
2948 /* 186 56 "8" */ CWORD_CWORD_CWORD_CWORD, 2945 /* 188 */ CWORD_CWORD_CWORD_CWORD,
2949 /* 187 57 "9" */ CWORD_CWORD_CWORD_CWORD, 2946 /* 189 */ CWORD_CWORD_CWORD_CWORD,
2950 /* 188 58 ":" */ CWORD_CCTL_CCTL_CWORD, 2947 /* 190 */ CWORD_CWORD_CWORD_CWORD,
2951 /* 189 59 ";" */ CSPCL_CWORD_CWORD_CWORD, 2948 /* 191 */ CWORD_CWORD_CWORD_CWORD,
2952 /* 190 60 "<" */ CSPCL_CWORD_CWORD_CWORD, 2949 /* 192 */ CWORD_CWORD_CWORD_CWORD,
2953 /* 191 61 "=" */ CWORD_CCTL_CCTL_CWORD, 2950 /* 193 */ CWORD_CWORD_CWORD_CWORD,
2954 /* 192 62 ">" */ CSPCL_CWORD_CWORD_CWORD, 2951 /* 194 */ CWORD_CWORD_CWORD_CWORD,
2955 /* 193 63 "?" */ CWORD_CCTL_CCTL_CWORD, 2952 /* 195 */ CWORD_CWORD_CWORD_CWORD,
2956 /* 194 64 "@" */ CWORD_CWORD_CWORD_CWORD, 2953 /* 196 */ CWORD_CWORD_CWORD_CWORD,
2957 /* 195 65 "A" */ CWORD_CWORD_CWORD_CWORD, 2954 /* 197 */ CWORD_CWORD_CWORD_CWORD,
2958 /* 196 66 "B" */ CWORD_CWORD_CWORD_CWORD, 2955 /* 198 */ CWORD_CWORD_CWORD_CWORD,
2959 /* 197 67 "C" */ CWORD_CWORD_CWORD_CWORD, 2956 /* 199 */ CWORD_CWORD_CWORD_CWORD,
2960 /* 198 68 "D" */ CWORD_CWORD_CWORD_CWORD, 2957 /* 200 */ CWORD_CWORD_CWORD_CWORD,
2961 /* 199 69 "E" */ CWORD_CWORD_CWORD_CWORD, 2958 /* 201 */ CWORD_CWORD_CWORD_CWORD,
2962 /* 200 70 "F" */ CWORD_CWORD_CWORD_CWORD, 2959 /* 202 */ CWORD_CWORD_CWORD_CWORD,
2963 /* 201 71 "G" */ CWORD_CWORD_CWORD_CWORD, 2960 /* 203 */ CWORD_CWORD_CWORD_CWORD,
2964 /* 202 72 "H" */ CWORD_CWORD_CWORD_CWORD, 2961 /* 204 */ CWORD_CWORD_CWORD_CWORD,
2965 /* 203 73 "I" */ CWORD_CWORD_CWORD_CWORD, 2962 /* 205 */ CWORD_CWORD_CWORD_CWORD,
2966 /* 204 74 "J" */ CWORD_CWORD_CWORD_CWORD, 2963 /* 206 */ CWORD_CWORD_CWORD_CWORD,
2967 /* 205 75 "K" */ CWORD_CWORD_CWORD_CWORD, 2964 /* 207 */ CWORD_CWORD_CWORD_CWORD,
2968 /* 206 76 "L" */ CWORD_CWORD_CWORD_CWORD, 2965 /* 208 */ CWORD_CWORD_CWORD_CWORD,
2969 /* 207 77 "M" */ CWORD_CWORD_CWORD_CWORD, 2966 /* 209 */ CWORD_CWORD_CWORD_CWORD,
2970 /* 208 78 "N" */ CWORD_CWORD_CWORD_CWORD, 2967 /* 210 */ CWORD_CWORD_CWORD_CWORD,
2971 /* 209 79 "O" */ CWORD_CWORD_CWORD_CWORD, 2968 /* 211 */ CWORD_CWORD_CWORD_CWORD,
2972 /* 210 80 "P" */ CWORD_CWORD_CWORD_CWORD, 2969 /* 212 */ CWORD_CWORD_CWORD_CWORD,
2973 /* 211 81 "Q" */ CWORD_CWORD_CWORD_CWORD, 2970 /* 213 */ CWORD_CWORD_CWORD_CWORD,
2974 /* 212 82 "R" */ CWORD_CWORD_CWORD_CWORD, 2971 /* 214 */ CWORD_CWORD_CWORD_CWORD,
2975 /* 213 83 "S" */ CWORD_CWORD_CWORD_CWORD, 2972 /* 215 */ CWORD_CWORD_CWORD_CWORD,
2976 /* 214 84 "T" */ CWORD_CWORD_CWORD_CWORD, 2973 /* 216 */ CWORD_CWORD_CWORD_CWORD,
2977 /* 215 85 "U" */ CWORD_CWORD_CWORD_CWORD, 2974 /* 217 */ CWORD_CWORD_CWORD_CWORD,
2978 /* 216 86 "V" */ CWORD_CWORD_CWORD_CWORD, 2975 /* 218 */ CWORD_CWORD_CWORD_CWORD,
2979 /* 217 87 "W" */ CWORD_CWORD_CWORD_CWORD, 2976 /* 219 */ CWORD_CWORD_CWORD_CWORD,
2980 /* 218 88 "X" */ CWORD_CWORD_CWORD_CWORD, 2977 /* 220 */ CWORD_CWORD_CWORD_CWORD,
2981 /* 219 89 "Y" */ CWORD_CWORD_CWORD_CWORD, 2978 /* 221 */ CWORD_CWORD_CWORD_CWORD,
2982 /* 220 90 "Z" */ CWORD_CWORD_CWORD_CWORD, 2979 /* 222 */ CWORD_CWORD_CWORD_CWORD,
2983 /* 221 91 "[" */ CWORD_CCTL_CCTL_CWORD, 2980 /* 223 */ CWORD_CWORD_CWORD_CWORD,
2984 /* 222 92 "\" */ CBACK_CBACK_CCTL_CBACK, 2981 /* 224 */ CWORD_CWORD_CWORD_CWORD,
2985 /* 223 93 "]" */ CWORD_CCTL_CCTL_CWORD, 2982 /* 225 */ CWORD_CWORD_CWORD_CWORD,
2986 /* 224 94 "^" */ CWORD_CWORD_CWORD_CWORD, 2983 /* 226 */ CWORD_CWORD_CWORD_CWORD,
2987 /* 225 95 "_" */ CWORD_CWORD_CWORD_CWORD, 2984 /* 227 */ CWORD_CWORD_CWORD_CWORD,
2988 /* 226 96 "`" */ CBQUOTE_CBQUOTE_CWORD_CBQUOTE, 2985 /* 228 */ CWORD_CWORD_CWORD_CWORD,
2989 /* 227 97 "a" */ CWORD_CWORD_CWORD_CWORD, 2986 /* 229 */ CWORD_CWORD_CWORD_CWORD,
2990 /* 228 98 "b" */ CWORD_CWORD_CWORD_CWORD, 2987 /* 230 */ CWORD_CWORD_CWORD_CWORD,
2991 /* 229 99 "c" */ CWORD_CWORD_CWORD_CWORD, 2988 /* 231 */ CWORD_CWORD_CWORD_CWORD,
2992 /* 230 100 "d" */ CWORD_CWORD_CWORD_CWORD, 2989 /* 232 */ CWORD_CWORD_CWORD_CWORD,
2993 /* 231 101 "e" */ CWORD_CWORD_CWORD_CWORD, 2990 /* 233 */ CWORD_CWORD_CWORD_CWORD,
2994 /* 232 102 "f" */ CWORD_CWORD_CWORD_CWORD, 2991 /* 234 */ CWORD_CWORD_CWORD_CWORD,
2995 /* 233 103 "g" */ CWORD_CWORD_CWORD_CWORD, 2992 /* 235 */ CWORD_CWORD_CWORD_CWORD,
2996 /* 234 104 "h" */ CWORD_CWORD_CWORD_CWORD, 2993 /* 236 */ CWORD_CWORD_CWORD_CWORD,
2997 /* 235 105 "i" */ CWORD_CWORD_CWORD_CWORD, 2994 /* 237 */ CWORD_CWORD_CWORD_CWORD,
2998 /* 236 106 "j" */ CWORD_CWORD_CWORD_CWORD, 2995 /* 238 */ CWORD_CWORD_CWORD_CWORD,
2999 /* 237 107 "k" */ CWORD_CWORD_CWORD_CWORD, 2996 /* 239 */ CWORD_CWORD_CWORD_CWORD,
3000 /* 238 108 "l" */ CWORD_CWORD_CWORD_CWORD, 2997 /* 230 */ CWORD_CWORD_CWORD_CWORD,
3001 /* 239 109 "m" */ CWORD_CWORD_CWORD_CWORD, 2998 /* 241 */ CWORD_CWORD_CWORD_CWORD,
3002 /* 240 110 "n" */ CWORD_CWORD_CWORD_CWORD, 2999 /* 242 */ CWORD_CWORD_CWORD_CWORD,
3003 /* 241 111 "o" */ CWORD_CWORD_CWORD_CWORD, 3000 /* 243 */ CWORD_CWORD_CWORD_CWORD,
3004 /* 242 112 "p" */ CWORD_CWORD_CWORD_CWORD, 3001 /* 244 */ CWORD_CWORD_CWORD_CWORD,
3005 /* 243 113 "q" */ CWORD_CWORD_CWORD_CWORD, 3002 /* 245 */ CWORD_CWORD_CWORD_CWORD,
3006 /* 244 114 "r" */ CWORD_CWORD_CWORD_CWORD, 3003 /* 246 */ CWORD_CWORD_CWORD_CWORD,
3007 /* 245 115 "s" */ CWORD_CWORD_CWORD_CWORD, 3004 /* 247 */ CWORD_CWORD_CWORD_CWORD,
3008 /* 246 116 "t" */ CWORD_CWORD_CWORD_CWORD, 3005 /* 248 */ CWORD_CWORD_CWORD_CWORD,
3009 /* 247 117 "u" */ CWORD_CWORD_CWORD_CWORD, 3006 /* 249 */ CWORD_CWORD_CWORD_CWORD,
3010 /* 248 118 "v" */ CWORD_CWORD_CWORD_CWORD, 3007 /* 250 */ CWORD_CWORD_CWORD_CWORD,
3011 /* 249 119 "w" */ CWORD_CWORD_CWORD_CWORD, 3008 /* 251 */ CWORD_CWORD_CWORD_CWORD,
3012 /* 250 120 "x" */ CWORD_CWORD_CWORD_CWORD, 3009 /* 252 */ CWORD_CWORD_CWORD_CWORD,
3013 /* 251 121 "y" */ CWORD_CWORD_CWORD_CWORD, 3010 /* 253 */ CWORD_CWORD_CWORD_CWORD,
3014 /* 252 122 "z" */ CWORD_CWORD_CWORD_CWORD, 3011 /* 254 */ CWORD_CWORD_CWORD_CWORD,
3015 /* 253 123 "{" */ CWORD_CWORD_CWORD_CWORD, 3012 /* 255 */ CWORD_CWORD_CWORD_CWORD,
3016 /* 254 124 "|" */ CSPCL_CWORD_CWORD_CWORD, 3013# if ENABLE_ASH_ALIAS
3017 /* 255 125 "}" */ CENDVAR_CENDVAR_CWORD_CENDVAR, 3014 /* PEOA */ CSPCL_CIGN_CIGN_CIGN,
3018 /* 256 126 "~" */ CWORD_CCTL_CCTL_CWORD, 3015# endif
3019 /* 257 127 */ CWORD_CWORD_CWORD_CWORD, 3016 /* PEOF */ CENDFILE_CENDFILE_CENDFILE_CENDFILE,
3020}; 3017};
3021 3018
3022#define SIT(c, syntax) (S_I_T[(int)syntax_index_table[(int)(c) + SYNBASE]][syntax]) 3019# define SIT(c, syntax) (S_I_T[syntax_index_table[c]][syntax])
3023 3020
3024#endif /* USE_SIT_FUNCTION */ 3021#endif /* USE_SIT_FUNCTION */
3025 3022
@@ -4232,9 +4229,10 @@ cmdputs(const char *s)
4232 }; 4229 };
4233 4230
4234 const char *p, *str; 4231 const char *p, *str;
4235 char c, cc[2] = " "; 4232 char cc[2] = " ";
4236 char *nextc; 4233 char *nextc;
4237 int subtype = 0; 4234 unsigned char c;
4235 unsigned char subtype = 0;
4238 int quoted = 0; 4236 int quoted = 0;
4239 4237
4240 nextc = makestrspace((strlen(s) + 1) * 8, cmdnextc); 4238 nextc = makestrspace((strlen(s) + 1) * 8, cmdnextc);
@@ -5459,7 +5457,7 @@ rmescapes(char *str, int flag)
5459 globbing = flag & RMESCAPE_GLOB; 5457 globbing = flag & RMESCAPE_GLOB;
5460 protect_against_glob = globbing; 5458 protect_against_glob = globbing;
5461 while (*p) { 5459 while (*p) {
5462 if (*p == CTLQUOTEMARK) { 5460 if ((unsigned char)*p == CTLQUOTEMARK) {
5463// TODO: if no RMESCAPE_QUOTED in flags, inquotes never becomes 0 5461// TODO: if no RMESCAPE_QUOTED in flags, inquotes never becomes 0
5464// (alternates between RMESCAPE_QUOTED and ~RMESCAPE_QUOTED). Is it ok? 5462// (alternates between RMESCAPE_QUOTED and ~RMESCAPE_QUOTED). Is it ok?
5465// Note: both inquotes and protect_against_glob only affect whether 5463// Note: both inquotes and protect_against_glob only affect whether
@@ -5474,7 +5472,7 @@ rmescapes(char *str, int flag)
5474 protect_against_glob = 0; 5472 protect_against_glob = 0;
5475 goto copy; 5473 goto copy;
5476 } 5474 }
5477 if (*p == CTLESC) { 5475 if ((unsigned char)*p == CTLESC) {
5478 p++; 5476 p++;
5479 if (protect_against_glob && inquotes && *p != '/') { 5477 if (protect_against_glob && inquotes && *p != '/') {
5480 *q++ = '\\'; 5478 *q++ = '\\';
@@ -5519,8 +5517,8 @@ memtodest(const char *p, size_t len, int syntax, int quotes)
5519 q = makestrspace(quotes ? len * 2 : len, q); 5517 q = makestrspace(quotes ? len * 2 : len, q);
5520 5518
5521 while (len--) { 5519 while (len--) {
5522 int c = signed_char2int(*p++); 5520 unsigned char c = *p++;
5523 if (!c) 5521 if (c == '\0')
5524 continue; 5522 continue;
5525 if (quotes) { 5523 if (quotes) {
5526 int n = SIT(c, syntax); 5524 int n = SIT(c, syntax);
@@ -5605,7 +5603,7 @@ removerecordregions(int endoff)
5605static char * 5603static char *
5606exptilde(char *startp, char *p, int flags) 5604exptilde(char *startp, char *p, int flags)
5607{ 5605{
5608 char c; 5606 unsigned char c;
5609 char *name; 5607 char *name;
5610 struct passwd *pw; 5608 struct passwd *pw;
5611 const char *home; 5609 const char *home;
@@ -5800,7 +5798,7 @@ expari(int quotes)
5800 do { 5798 do {
5801 int esc; 5799 int esc;
5802 5800
5803 while (*p != CTLARI) { 5801 while ((unsigned char)*p != CTLARI) {
5804 p--; 5802 p--;
5805#if DEBUG 5803#if DEBUG
5806 if (p < start) { 5804 if (p < start) {
@@ -5862,10 +5860,9 @@ argstr(char *p, int flags, struct strlist *var_str_list)
5862#if ENABLE_SH_MATH_SUPPORT 5860#if ENABLE_SH_MATH_SUPPORT
5863 CTLENDARI, 5861 CTLENDARI,
5864#endif 5862#endif
5865 0 5863 '\0'
5866 }; 5864 };
5867 const char *reject = spclchars; 5865 const char *reject = spclchars;
5868 int c;
5869 int quotes = flags & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */ 5866 int quotes = flags & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */
5870 int breakall = flags & EXP_WORD; 5867 int breakall = flags & EXP_WORD;
5871 int inquotes; 5868 int inquotes;
@@ -5893,8 +5890,10 @@ argstr(char *p, int flags, struct strlist *var_str_list)
5893 start: 5890 start:
5894 startloc = expdest - (char *)stackblock(); 5891 startloc = expdest - (char *)stackblock();
5895 for (;;) { 5892 for (;;) {
5893 unsigned char c;
5894
5896 length += strcspn(p + length, reject); 5895 length += strcspn(p + length, reject);
5897 c = (unsigned char) p[length]; 5896 c = p[length];
5898 if (c) { 5897 if (c) {
5899 if (!(c & 0x80) 5898 if (!(c & 0x80)
5900#if ENABLE_SH_MATH_SUPPORT 5899#if ENABLE_SH_MATH_SUPPORT
@@ -6049,7 +6048,7 @@ scanleft(char *startp, char *rmesc, char *rmescend UNUSED_PARAM, char *str, int
6049 *loc2 = c; 6048 *loc2 = c;
6050 if (match) // if (!match) 6049 if (match) // if (!match)
6051 return loc; 6050 return loc;
6052 if (quotes && *loc == CTLESC) 6051 if (quotes && (unsigned char)*loc == CTLESC)
6053 loc++; 6052 loc++;
6054 loc++; 6053 loc++;
6055 loc2++; 6054 loc2++;
@@ -6101,7 +6100,7 @@ varunset(const char *end, const char *var, const char *umsg, int varflags)
6101 tail = nullstr; 6100 tail = nullstr;
6102 msg = "parameter not set"; 6101 msg = "parameter not set";
6103 if (umsg) { 6102 if (umsg) {
6104 if (*end == CTLENDVAR) { 6103 if ((unsigned char)*end == CTLENDVAR) {
6105 if (varflags & VSNUL) 6104 if (varflags & VSNUL)
6106 tail = " or null"; 6105 tail = " or null";
6107 } else { 6106 } else {
@@ -6185,7 +6184,7 @@ subevalvar(char *p, char *str, int strloc, int subtype,
6185 6184
6186 /* Adjust the length by the number of escapes */ 6185 /* Adjust the length by the number of escapes */
6187 for (ptr = startp; ptr < (str - 1); ptr++) { 6186 for (ptr = startp; ptr < (str - 1); ptr++) {
6188 if (*ptr == CTLESC) { 6187 if ((unsigned char)*ptr == CTLESC) {
6189 len--; 6188 len--;
6190 ptr++; 6189 ptr++;
6191 } 6190 }
@@ -6219,11 +6218,11 @@ subevalvar(char *p, char *str, int strloc, int subtype,
6219 len = orig_len - pos; 6218 len = orig_len - pos;
6220 6219
6221 for (str = startp; pos; str++, pos--) { 6220 for (str = startp; pos; str++, pos--) {
6222 if (quotes && *str == CTLESC) 6221 if (quotes && (unsigned char)*str == CTLESC)
6223 str++; 6222 str++;
6224 } 6223 }
6225 for (loc = startp; len; len--) { 6224 for (loc = startp; len; len--) {
6226 if (quotes && *str == CTLESC) 6225 if (quotes && (unsigned char)*str == CTLESC)
6227 *loc++ = *str++; 6226 *loc++ = *str++;
6228 *loc++ = *str++; 6227 *loc++ = *str++;
6229 } 6228 }
@@ -6287,7 +6286,7 @@ subevalvar(char *p, char *str, int strloc, int subtype,
6287 /* No match, advance */ 6286 /* No match, advance */
6288 restart_detect = stackblock(); 6287 restart_detect = stackblock();
6289 STPUTC(*idx, expdest); 6288 STPUTC(*idx, expdest);
6290 if (quotes && *idx == CTLESC) { 6289 if (quotes && (unsigned char)*idx == CTLESC) {
6291 idx++; 6290 idx++;
6292 len++; 6291 len++;
6293 STPUTC(*idx, expdest); 6292 STPUTC(*idx, expdest);
@@ -6302,7 +6301,7 @@ subevalvar(char *p, char *str, int strloc, int subtype,
6302 6301
6303 if (subtype == VSREPLACEALL) { 6302 if (subtype == VSREPLACEALL) {
6304 while (idx < loc) { 6303 while (idx < loc) {
6305 if (quotes && *idx == CTLESC) 6304 if (quotes && (unsigned char)*idx == CTLESC)
6306 idx++; 6305 idx++;
6307 idx++; 6306 idx++;
6308 rmesc++; 6307 rmesc++;
@@ -6437,7 +6436,7 @@ varvalue(char *name, int varflags, int flags, struct strlist *var_str_list)
6437 goto param; 6436 goto param;
6438 /* fall through */ 6437 /* fall through */
6439 case '*': 6438 case '*':
6440 sep = ifsset() ? signed_char2int(ifsval()[0]) : ' '; 6439 sep = ifsset() ? (unsigned char)(ifsval()[0]) : ' ';
6441 if (quotes && (SIT(sep, syntax) == CCTL || SIT(sep, syntax) == CBACK)) 6440 if (quotes && (SIT(sep, syntax) == CCTL || SIT(sep, syntax) == CBACK))
6442 sepq = 1; 6441 sepq = 1;
6443 param: 6442 param:
@@ -6655,7 +6654,7 @@ evalvar(char *p, int flags, struct strlist *var_str_list)
6655 if (subtype != VSNORMAL) { /* skip to end of alternative */ 6654 if (subtype != VSNORMAL) { /* skip to end of alternative */
6656 int nesting = 1; 6655 int nesting = 1;
6657 for (;;) { 6656 for (;;) {
6658 char c = *p++; 6657 unsigned char c = *p++;
6659 if (c == CTLESC) 6658 if (c == CTLESC)
6660 p++; 6659 p++;
6661 else if (c == CTLBACKQ || c == (CTLBACKQ|CTLQUOTE)) { 6660 else if (c == CTLBACKQ || c == (CTLBACKQ|CTLQUOTE)) {
@@ -6703,7 +6702,7 @@ ifsbreakup(char *string, struct arglist *arglist)
6703 ifsspc = 0; 6702 ifsspc = 0;
6704 while (p < string + ifsp->endoff) { 6703 while (p < string + ifsp->endoff) {
6705 q = p; 6704 q = p;
6706 if (*p == CTLESC) 6705 if ((unsigned char)*p == CTLESC)
6707 p++; 6706 p++;
6708 if (!strchr(ifs, *p)) { 6707 if (!strchr(ifs, *p)) {
6709 p++; 6708 p++;
@@ -6729,7 +6728,7 @@ ifsbreakup(char *string, struct arglist *arglist)
6729 break; 6728 break;
6730 } 6729 }
6731 q = p; 6730 q = p;
6732 if (*p == CTLESC) 6731 if ((unsigned char)*p == CTLESC)
6733 p++; 6732 p++;
6734 if (strchr(ifs, *p) == NULL) { 6733 if (strchr(ifs, *p) == NULL) {
6735 p = q; 6734 p = q;
@@ -9456,12 +9455,6 @@ preadfd(void)
9456 */ 9455 */
9457//#define pgetc_debug(...) bb_error_msg(__VA_ARGS__) 9456//#define pgetc_debug(...) bb_error_msg(__VA_ARGS__)
9458#define pgetc_debug(...) ((void)0) 9457#define pgetc_debug(...) ((void)0)
9459/*
9460 * NB: due to SIT(c) internals (syntax_index_table[] vector),
9461 * pgetc() and related functions must return chars SIGN-EXTENDED into ints,
9462 * not zero-extended. Seems fragile to me. Affects only !USE_SIT_FUNCTION case,
9463 * so we can fix it by ditching !USE_SIT_FUNCTION if Unicode requires that.
9464 */
9465static int 9458static int
9466preadbuffer(void) 9459preadbuffer(void)
9467{ 9460{
@@ -9562,12 +9555,12 @@ preadbuffer(void)
9562 g_parsefile->left_in_line, 9555 g_parsefile->left_in_line,
9563 g_parsefile->next_to_pgetc, 9556 g_parsefile->next_to_pgetc,
9564 g_parsefile->next_to_pgetc); 9557 g_parsefile->next_to_pgetc);
9565 return signed_char2int(*g_parsefile->next_to_pgetc++); 9558 return (unsigned char)*g_parsefile->next_to_pgetc++;
9566} 9559}
9567 9560
9568#define pgetc_as_macro() \ 9561#define pgetc_as_macro() \
9569 (--g_parsefile->left_in_line >= 0 \ 9562 (--g_parsefile->left_in_line >= 0 \
9570 ? signed_char2int(*g_parsefile->next_to_pgetc++) \ 9563 ? (unsigned char)*g_parsefile->next_to_pgetc++ \
9571 : preadbuffer() \ 9564 : preadbuffer() \
9572 ) 9565 )
9573 9566
@@ -10437,15 +10430,13 @@ fixredir(union node *n, const char *text, int err)
10437static int 10430static int
10438noexpand(const char *text) 10431noexpand(const char *text)
10439{ 10432{
10440 const char *p; 10433 unsigned char c;
10441 char c;
10442 10434
10443 p = text; 10435 while ((c = *text++) != '\0') {
10444 while ((c = *p++) != '\0') {
10445 if (c == CTLQUOTEMARK) 10436 if (c == CTLQUOTEMARK)
10446 continue; 10437 continue;
10447 if (c == CTLESC) 10438 if (c == CTLESC)
10448 p++; 10439 text++;
10449 else if (SIT((signed char)c, BASESYNTAX) == CCTL) 10440 else if (SIT((signed char)c, BASESYNTAX) == CCTL)
10450 return 0; 10441 return 0;
10451 } 10442 }
@@ -10831,7 +10822,7 @@ static int decode_dollar_squote(void)
10831 * If eofmark is NULL, read a word or a redirection symbol. If eofmark 10822 * If eofmark is NULL, read a word or a redirection symbol. If eofmark
10832 * is not NULL, read a here document. In the latter case, eofmark is the 10823 * is not NULL, read a here document. In the latter case, eofmark is the
10833 * word which marks the end of the document and striptabs is true if 10824 * word which marks the end of the document and striptabs is true if
10834 * leading tabs should be stripped from the document. The argument firstc 10825 * leading tabs should be stripped from the document. The argument c
10835 * is the first character of the input token or document. 10826 * is the first character of the input token or document.
10836 * 10827 *
10837 * Because C does not have internal subroutines, I have simulated them 10828 * Because C does not have internal subroutines, I have simulated them
@@ -10845,10 +10836,10 @@ static int decode_dollar_squote(void)
10845#define PARSEBACKQNEW() {oldstyle = 0; goto parsebackq; parsebackq_newreturn:;} 10836#define PARSEBACKQNEW() {oldstyle = 0; goto parsebackq; parsebackq_newreturn:;}
10846#define PARSEARITH() {goto parsearith; parsearith_return:;} 10837#define PARSEARITH() {goto parsearith; parsearith_return:;}
10847static int 10838static int
10848readtoken1(int firstc, int syntax, char *eofmark, int striptabs) 10839readtoken1(int c, int syntax, char *eofmark, int striptabs)
10849{ 10840{
10850 /* NB: syntax parameter fits into smallint */ 10841 /* NB: syntax parameter fits into smallint */
10851 int c = firstc; 10842 /* c parameter is an unsigned char or PEOF or PEOA */
10852 char *out; 10843 char *out;
10853 int len; 10844 int len;
10854 char line[EOFMARKLEN + 1]; 10845 char line[EOFMARKLEN + 1];
@@ -11213,14 +11204,14 @@ parseredir: {
11213 (((unsigned)(c) - 33 < 32) \ 11204 (((unsigned)(c) - 33 < 32) \
11214 && ((0xc1ff920dU >> ((unsigned)(c) - 33)) & 1)) 11205 && ((0xc1ff920dU >> ((unsigned)(c) - 33)) & 1))
11215parsesub: { 11206parsesub: {
11216 int subtype; 11207 unsigned char subtype;
11217 int typeloc; 11208 int typeloc;
11218 int flags; 11209 int flags;
11219 char *p; 11210 char *p;
11220 static const char types[] ALIGN1 = "}-+?="; 11211 static const char types[] ALIGN1 = "}-+?=";
11221 11212
11222 c = pgetc(); 11213 c = pgetc();
11223 if (c <= PEOA_OR_PEOF 11214 if (c > 255 /* PEOA or PEOF */
11224 || (c != '(' && c != '{' && !is_name(c) && !is_special(c)) 11215 || (c != '(' && c != '{' && !is_name(c) && !is_special(c))
11225 ) { 11216 ) {
11226#if ENABLE_ASH_BASH_COMPAT 11217#if ENABLE_ASH_BASH_COMPAT
@@ -11257,11 +11248,11 @@ parsesub: {
11257 } else 11248 } else
11258 subtype = 0; 11249 subtype = 0;
11259 } 11250 }
11260 if (c > PEOA_OR_PEOF && is_name(c)) { 11251 if (c <= 255 /* not PEOA or PEOF */ && is_name(c)) {
11261 do { 11252 do {
11262 STPUTC(c, out); 11253 STPUTC(c, out);
11263 c = pgetc(); 11254 c = pgetc();
11264 } while (c > PEOA_OR_PEOF && is_in_name(c)); 11255 } while (c <= 255 /* not PEOA or PEOF */ && is_in_name(c));
11265 } else if (isdigit(c)) { 11256 } else if (isdigit(c)) {
11266 do { 11257 do {
11267 STPUTC(c, out); 11258 STPUTC(c, out);
@@ -11325,7 +11316,7 @@ parsesub: {
11325 } 11316 }
11326 if (dblquote || arinest) 11317 if (dblquote || arinest)
11327 flags |= VSQUOTE; 11318 flags |= VSQUOTE;
11328 *((char *)stackblock() + typeloc) = subtype | flags; 11319 ((unsigned char *)stackblock())[typeloc] = subtype | flags;
11329 if (subtype != VSNORMAL) { 11320 if (subtype != VSNORMAL) {
11330 varnest++; 11321 varnest++;
11331 if (dblquote || arinest) { 11322 if (dblquote || arinest) {
@@ -11409,7 +11400,7 @@ parsebackq: {
11409 if (pc != '\\' && pc != '`' && pc != '$' 11400 if (pc != '\\' && pc != '`' && pc != '$'
11410 && (!dblquote || pc != '"')) 11401 && (!dblquote || pc != '"'))
11411 STPUTC('\\', pout); 11402 STPUTC('\\', pout);
11412 if (pc > PEOA_OR_PEOF) { 11403 if (pc <= 255 /* not PEOA or PEOF */) {
11413 break; 11404 break;
11414 } 11405 }
11415 /* fall through */ 11406 /* fall through */