26char *
fmtquote(
const char *as,
const char *qb,
const char *qe) {
27 const size_t n = strlen(as);
28 const unsigned char *
s = (
const unsigned char *) as;
29 const unsigned char *e =
s + n;
36 if (qb[0] ==
'$' && qb[1] ==
'\'' && qb[2] == 0)
81 PUT((
char)(
'0' + ((c >> 6) & 07)));
82 PUT((
char)(
'0' + ((c >> 3) & 07)));
86 }
else if (qe && strchr(qe, c)) {
93 (strchr(
"\";~&|()<>[]*?", c) ||
106 const size_t move_by = (size_t)(shell + !spaced);
109 agxbput(&b, content + move_by);
113 if (qe && (escaped || spaced))
123char *
fmtesq(
const char *as,
const char *qs)
static agxbuf last
last message
static char * agxbdisown(agxbuf *xb)
char * fmtesq(const char *as, const char *qs)
char * fmtesc(const char *as)
char * fmtquote(const char *as, const char *qb, const char *qe)
quote string as with qb...qe
replacements for ctype.h functions
static bool gv_iscntrl(int c)
static bool gv_isprint(int c)
static bool gv_isspace(int c)