#define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
#define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
+/* C99 say: "char" declaration may be signed or unsigned default */
+#define SC2INT(chr2may_be_negative_int) (int)((signed char)chr2may_be_negative_int)
+
/*
* is_special(c) evaluates to 1 for c in "!#$*-0123456789?@"; 0 otherwise
* (assuming ascii char codes, as the original implementation did)
return S_I_T[indx][syntax];
}
-#else /* USE_SIT_FUNCTION */
+#else /* USE_SIT_FUNCTION */
#define SIT(c, syntax) S_I_T[(int)syntax_index_table[((int)c)+SYNBASE]][syntax]
q = makestrspace(len * 2, q);
while (len--) {
- int c = *p++;
+ int c = SC2INT(*p++);
if (!c)
continue;
if (quotes && (SIT(c, syntax) == CCTL || SIT(c, syntax) == CBACK))
goto param;
/* fall through */
case '*':
- sep = ifsset() ? ifsval()[0] : ' ';
+ sep = ifsset() ? SC2INT(ifsval()[0]) : ' ';
if (quotes && (SIT(sep, syntax) == CCTL || SIT(sep, syntax) == CBACK))
sepq = 1;
param:
* Nul characters in the input are silently discarded.
*/
-#define pgetc_as_macro() (--parsenleft >= 0? *parsenextc++ : preadbuffer())
+
+#define pgetc_as_macro() (--parsenleft >= 0? SC2INT(*parsenextc++) : preadbuffer())
#ifdef CONFIG_ASH_OPTIMIZE_FOR_SIZE
#define pgetc_macro() pgetc()
#endif
popstring();
if (--parsenleft >= 0)
- return (*parsenextc++);
+ return SC2INT(*parsenextc++);
}
if (parsenleft == EOF_NLEFT || parsefile->buf == NULL)
return PEOF;
*q = savec;
- return *parsenextc++;
+ return SC2INT(*parsenextc++);
}
/*
if (doprompt)
setprompt(2);
} else {
- if (
- dblquote &&
+ if (dblquote &&
c != '\\' && c != '`' &&
c != '$' && (
c != '"' ||
- eofmark != NULL
- )
+ eofmark != NULL)
) {
USTPUTC(CTLESC, out);
USTPUTC('\\', out);