clean up chtypes use
This commit is contained in:
parent
59619ee2ab
commit
cc6857dfb6
5
edit.c
5
edit.c
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#ifndef MKSH_NO_CMDLINE_EDITING
|
#ifndef MKSH_NO_CMDLINE_EDITING
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.305 2016/08/01 14:25:39 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.306 2016/08/01 18:42:40 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in later versions we might use libtermcap for this, but since external
|
* in later versions we might use libtermcap for this, but since external
|
||||||
@ -843,12 +843,11 @@ static int
|
|||||||
x_escape(const char *s, size_t len, int (*putbuf_func)(const char *, size_t))
|
x_escape(const char *s, size_t len, int (*putbuf_func)(const char *, size_t))
|
||||||
{
|
{
|
||||||
size_t add = 0, wlen = len;
|
size_t add = 0, wlen = len;
|
||||||
const char *ifs = str_val(local("IFS", 0));
|
|
||||||
int rval = 0;
|
int rval = 0;
|
||||||
|
|
||||||
while (wlen - add > 0)
|
while (wlen - add > 0)
|
||||||
if (vstrchr("\"#$&'()*:;<=>?[\\`{|}", s[add]) ||
|
if (vstrchr("\"#$&'()*:;<=>?[\\`{|}", s[add]) ||
|
||||||
vstrchr(ifs, s[add])) {
|
ctype(s[add], C_IFS)) {
|
||||||
if (putbuf_func(s, add) != 0) {
|
if (putbuf_func(s, add) != 0) {
|
||||||
rval = -1;
|
rval = -1;
|
||||||
break;
|
break;
|
||||||
|
10
misc.c
10
misc.c
@ -30,7 +30,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.244 2016/07/25 20:36:28 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.245 2016/08/01 18:42:42 tg Exp $");
|
||||||
|
|
||||||
#define KSH_CHVT_FLAG
|
#define KSH_CHVT_FLAG
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
@ -78,12 +78,12 @@ static int make_path(const char *, const char *, char **, XString *, int *);
|
|||||||
void
|
void
|
||||||
setctypes(const char *s, int t)
|
setctypes(const char *s, int t)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
if (t & C_IFS) {
|
if (t & C_IFS) {
|
||||||
for (i = 0; i < UCHAR_MAX + 1; i++)
|
unsigned int i = 0;
|
||||||
|
|
||||||
|
while (++i <= UCHAR_MAX)
|
||||||
chtypes[i] &= ~C_IFS;
|
chtypes[i] &= ~C_IFS;
|
||||||
/* include \0 in C_IFS */
|
/* include '\0' in C_IFS */
|
||||||
chtypes[0] |= C_IFS;
|
chtypes[0] |= C_IFS;
|
||||||
}
|
}
|
||||||
while (*s != 0)
|
while (*s != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user