disable mksh feature -T in lksh

This commit is contained in:
tg 2012-06-26 19:22:19 +00:00
parent 967b68e08e
commit cbeac6b381

25
misc.c
View File

@ -30,7 +30,20 @@
#include <grp.h> #include <grp.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.193 2012/05/05 17:37:43 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.194 2012/06/26 19:22:19 tg Exp $");
#define KSH_CHVT_FLAG
#ifdef MKSH_SMALL
#undef KSH_CHVT_FLAG
#endif
#ifdef TIOCSCTTY
#define KSH_CHVT_CODE
#define KSH_CHVT_FLAG
#endif
#ifdef MKSH_LEGACY_MODE
#undef KSH_CHVT_CODE
#undef KSH_CHVT_FLAG
#endif
/* type bits for unsigned char */ /* type bits for unsigned char */
unsigned char chtypes[UCHAR_MAX + 1]; unsigned char chtypes[UCHAR_MAX + 1];
@ -40,7 +53,7 @@ static const unsigned char *pat_scan(const unsigned char *,
static int do_gmatch(const unsigned char *, const unsigned char *, static int do_gmatch(const unsigned char *, const unsigned char *,
const unsigned char *, const unsigned char *); const unsigned char *, const unsigned char *);
static const unsigned char *cclass(const unsigned char *, int); static const unsigned char *cclass(const unsigned char *, int);
#ifdef TIOCSCTTY #ifdef KSH_CHVT_CODE
static void chvt(const char *); static void chvt(const char *);
#endif #endif
@ -300,7 +313,7 @@ parse_args(const char **argv,
/* see cmd_opts[] declaration */ /* see cmd_opts[] declaration */
*p++ = 'o'; *p++ = 'o';
*p++ = ':'; *p++ = ':';
#if !defined(MKSH_SMALL) || defined(TIOCSCTTY) #ifdef KSH_CHVT_FLAG
*p++ = 'T'; *p++ = 'T';
*p++ = ':'; *p++ = ':';
#endif #endif
@ -381,11 +394,11 @@ parse_args(const char **argv,
} }
break; break;
#if !defined(MKSH_SMALL) || defined(TIOCSCTTY) #ifdef KSH_CHVT_FLAG
case 'T': case 'T':
if (what != OF_FIRSTTIME) if (what != OF_FIRSTTIME)
break; break;
#ifndef TIOCSCTTY #ifndef KSH_CHVT_CODE
errorf("no TIOCSCTTY ioctl"); errorf("no TIOCSCTTY ioctl");
#else #else
change_flag(FTALKING, OF_CMDLINE, 1); change_flag(FTALKING, OF_CMDLINE, 1);
@ -1885,7 +1898,7 @@ c_cd(const char **wp)
} }
#ifdef TIOCSCTTY #ifdef KSH_CHVT_CODE
extern void chvt_reinit(void); extern void chvt_reinit(void);
static void static void