apply most of the remaining parts of the EBCDIC patch, sans the CTRL() changes
This commit is contained in:
parent
d658ad626b
commit
1289bc69fb
58
Build.sh
58
Build.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.717 2017/04/28 00:27:48 tg Exp $'
|
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.718 2017/04/28 02:24:53 tg Exp $'
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
# 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
# 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
||||||
@ -53,6 +53,17 @@ alll=qwertyuiopasdfghjklzxcvbnm
|
|||||||
alln=0123456789
|
alln=0123456789
|
||||||
alls=______________________________________________________________
|
alls=______________________________________________________________
|
||||||
|
|
||||||
|
case `echo a | tr '\201' X` in
|
||||||
|
X)
|
||||||
|
ebcdic=true
|
||||||
|
lfcr='\n\r'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ebcdic=false
|
||||||
|
lfcr='\012\015'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
genopt_die() {
|
genopt_die() {
|
||||||
if test -n "$1"; then
|
if test -n "$1"; then
|
||||||
echo >&2 "E: $*"
|
echo >&2 "E: $*"
|
||||||
@ -425,7 +436,7 @@ ac_header() {
|
|||||||
na=0
|
na=0
|
||||||
fi
|
fi
|
||||||
hf=$1; shift
|
hf=$1; shift
|
||||||
hv=`echo "$hf" | tr -d '\012\015' | tr -c $alll$allu$alln $alls`
|
hv=`echo "$hf" | tr -d "$lfcr" | tr -c $alll$allu$alln $alls`
|
||||||
echo "/* NeXTstep bug workaround */" >x
|
echo "/* NeXTstep bug workaround */" >x
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
@ -905,6 +916,13 @@ the mksh-os2 porter.
|
|||||||
] incompatibilities with $y.
|
] incompatibilities with $y.
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
|
OS/390)
|
||||||
|
add_cppflags -DMKSH_ASSUME_UTF8=0; HAVE_ISSET_MKSH_ASSUME_UTF8=1
|
||||||
|
: "${SIZE=: size}"
|
||||||
|
add_cppflags -DMKSH_FOR_Z_OS
|
||||||
|
add_cppflags -D_ALL_SOURCE
|
||||||
|
oswarn='; EBCDIC support is incomplete'
|
||||||
|
;;
|
||||||
OSF1)
|
OSF1)
|
||||||
HAVE_SIG_T=0 # incompatible
|
HAVE_SIG_T=0 # incompatible
|
||||||
add_cppflags -D_OSF_SOURCE
|
add_cppflags -D_OSF_SOURCE
|
||||||
@ -1403,8 +1421,16 @@ watcom)
|
|||||||
DOWARN=-Wc,-we
|
DOWARN=-Wc,-we
|
||||||
;;
|
;;
|
||||||
xlc)
|
xlc)
|
||||||
save_NOWARN=-qflag=i:e
|
case $TARGET_OS in
|
||||||
DOWARN=-qflag=i:i
|
OS/390)
|
||||||
|
save_NOWARN=-qflag=e
|
||||||
|
DOWARN=-qflag=i
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
save_NOWARN=-qflag=i:e
|
||||||
|
DOWARN=-qflag=i:i
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
test x"$save_NOWARN" = x"" && save_NOWARN=-Wno-error
|
test x"$save_NOWARN" = x"" && save_NOWARN=-Wno-error
|
||||||
@ -1574,10 +1600,24 @@ tendra)
|
|||||||
ac_flags 1 extansi -Xa
|
ac_flags 1 extansi -Xa
|
||||||
;;
|
;;
|
||||||
xlc)
|
xlc)
|
||||||
ac_flags 1 rodata "-qro -qroconst -qroptr"
|
case $TARGET_OS in
|
||||||
ac_flags 1 rtcheck -qcheck=all
|
OS/390)
|
||||||
#ac_flags 1 rtchkc -qextchk # reported broken
|
# On IBM z/OS, the following are warnings by default:
|
||||||
ac_flags 1 wformat "-qformat=all -qformat=nozln"
|
# CCN3296: #include file <foo.h> not found.
|
||||||
|
# CCN3944: Attribute "__foo__" is not supported and is ignored.
|
||||||
|
# CCN3963: The attribute "foo" is not a valid variable attribute and is ignored.
|
||||||
|
ac_flags 1 halton '-qhaltonmsg=CCN3296 -qhaltonmsg=CCN3944 -qhaltonmsg=CCN3963'
|
||||||
|
# CCN3290: Unknown macro name FOO on #undef directive.
|
||||||
|
# CCN4108: The use of keyword '__attribute__' is non-portable.
|
||||||
|
ac_flags 1 supprss '-qsuppress=CCN3290 -qsuppress=CCN4108'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ac_flags 1 rodata '-qro -qroconst -qroptr'
|
||||||
|
ac_flags 1 rtcheck -qcheck=all
|
||||||
|
#ac_flags 1 rtchkc -qextchk # reported broken
|
||||||
|
ac_flags 1 wformat '-qformat=all -qformat=nozln'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
#ac_flags 1 wp64 -qwarn64 # too verbose for now
|
#ac_flags 1 wp64 -qwarn64 # too verbose for now
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -2658,7 +2698,7 @@ MKSH_A4PB force use of arc4random_pushb
|
|||||||
MKSH_ASSUME_UTF8 (0=disabled, 1=enabled; default: unset)
|
MKSH_ASSUME_UTF8 (0=disabled, 1=enabled; default: unset)
|
||||||
MKSH_BINSHPOSIX if */sh or */-sh, enable set -o posix
|
MKSH_BINSHPOSIX if */sh or */-sh, enable set -o posix
|
||||||
MKSH_BINSHREDUCED if */sh or */-sh, enable set -o sh
|
MKSH_BINSHREDUCED if */sh or */-sh, enable set -o sh
|
||||||
MKSH_CLS_STRING "\033[;H\033[J"
|
MKSH_CLS_STRING KSH_ESC_STRING "[;H" KSH_ESC_STRING "[J"
|
||||||
MKSH_DEFAULT_EXECSHELL "/bin/sh" (do not change)
|
MKSH_DEFAULT_EXECSHELL "/bin/sh" (do not change)
|
||||||
MKSH_DEFAULT_PROFILEDIR "/etc" (do not change)
|
MKSH_DEFAULT_PROFILEDIR "/etc" (do not change)
|
||||||
MKSH_DEFAULT_TMPDIR "/tmp" (do not change)
|
MKSH_DEFAULT_TMPDIR "/tmp" (do not change)
|
||||||
|
4
check.t
4
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.779 2017/04/28 00:38:25 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.780 2017/04/28 02:24:54 tg Exp $
|
||||||
# -*- mode: sh -*-
|
# -*- mode: sh -*-
|
||||||
#-
|
#-
|
||||||
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
@ -1373,7 +1373,7 @@ file-setup: file 644 "x"
|
|||||||
cd -P$1 subdir
|
cd -P$1 subdir
|
||||||
echo 2=$?,${PWD#$bwd/}
|
echo 2=$?,${PWD#$bwd/}
|
||||||
cd $bwd
|
cd $bwd
|
||||||
chmod 755 renamed
|
chmod 755 noread renamed 2>/dev/null
|
||||||
rm -rf noread link renamed
|
rm -rf noread link renamed
|
||||||
stdin:
|
stdin:
|
||||||
export TSHELL="$__progname"
|
export TSHELL="$__progname"
|
||||||
|
10
edit.c
10
edit.c
@ -28,16 +28,16 @@
|
|||||||
|
|
||||||
#ifndef MKSH_NO_CMDLINE_EDITING
|
#ifndef MKSH_NO_CMDLINE_EDITING
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.330 2017/04/28 00:49:32 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.331 2017/04/28 02:24:56 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
|
||||||
* dependencies are problematic, this has not yet been decided on; another
|
* dependencies are problematic, this has not yet been decided on; another
|
||||||
* good string is "\033c" except on hardware terminals like the DEC VT420
|
* good string is KSH_ESC_STRING "c" except on hardware terminals like the
|
||||||
* which do a full power cycle then...
|
* DEC VT420 which do a full power cycle then...
|
||||||
*/
|
*/
|
||||||
#ifndef MKSH_CLS_STRING
|
#ifndef MKSH_CLS_STRING
|
||||||
#define MKSH_CLS_STRING "\033[;H\033[J"
|
#define MKSH_CLS_STRING KSH_ESC_STRING "[;H" KSH_ESC_STRING "[J"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* tty driver characters we are interested in */
|
/* tty driver characters we are interested in */
|
||||||
@ -2087,7 +2087,7 @@ x_clrtoeol(int lastch, bool line_was_cleared)
|
|||||||
int col;
|
int col;
|
||||||
|
|
||||||
if (lastch == ' ' && !line_was_cleared && x_term_mode == 1) {
|
if (lastch == ' ' && !line_was_cleared && x_term_mode == 1) {
|
||||||
shf_puts("\033[K", shl_out);
|
shf_puts(KSH_ESC_STRING "[K", shl_out);
|
||||||
line_was_cleared = true;
|
line_was_cleared = true;
|
||||||
}
|
}
|
||||||
if (lastch == ' ' && line_was_cleared)
|
if (lastch == ' ' && line_was_cleared)
|
||||||
|
20
misc.c
20
misc.c
@ -5,6 +5,8 @@
|
|||||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
* 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
* 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
||||||
* mirabilos <m@mirbsd.org>
|
* mirabilos <m@mirbsd.org>
|
||||||
|
* Copyright (c) 2015
|
||||||
|
* Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||||
*
|
*
|
||||||
* Provided that these terms and disclaimer and all copyright notices
|
* Provided that these terms and disclaimer and all copyright notices
|
||||||
* are retained or reproduced in an accompanying document, permission
|
* are retained or reproduced in an accompanying document, permission
|
||||||
@ -30,7 +32,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.265 2017/04/28 00:49:33 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.266 2017/04/28 02:24:57 tg Exp $");
|
||||||
|
|
||||||
#define KSH_CHVT_FLAG
|
#define KSH_CHVT_FLAG
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
@ -1170,11 +1172,11 @@ print_value_quoted(struct shf *shf, const char *s)
|
|||||||
c = 't';
|
c = 't';
|
||||||
if (0)
|
if (0)
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case 11:
|
case KSH_VTAB:
|
||||||
c = 'v';
|
c = 'v';
|
||||||
if (0)
|
if (0)
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case '\033':
|
case KSH_ESC:
|
||||||
/* take E not e because \e is \ in *roff */
|
/* take E not e because \e is \ in *roff */
|
||||||
c = 'E';
|
c = 'E';
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
@ -1184,7 +1186,12 @@ print_value_quoted(struct shf *shf, const char *s)
|
|||||||
if (0)
|
if (0)
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
if (c < 32 || c > 0x7E) {
|
#ifdef MKSH_EBCDIC
|
||||||
|
if (c < 64 || c == 0xFF)
|
||||||
|
#else
|
||||||
|
if (c < 32 || c > 0x7E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case '\'':
|
case '\'':
|
||||||
shf_fprintf(shf, "\\%03o", c);
|
shf_fprintf(shf, "\\%03o", c);
|
||||||
@ -2148,7 +2155,7 @@ unbksl(bool cstyle, int (*fg)(void), void (*fp)(int))
|
|||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
case 'e':
|
case 'e':
|
||||||
wc = 033;
|
wc = KSH_ESC;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
wc = '\f';
|
wc = '\f';
|
||||||
@ -2163,8 +2170,7 @@ unbksl(bool cstyle, int (*fg)(void), void (*fp)(int))
|
|||||||
wc = '\t';
|
wc = '\t';
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
/* assume ASCII here as well */
|
wc = KSH_VTAB;
|
||||||
wc = 11;
|
|
||||||
break;
|
break;
|
||||||
case '1':
|
case '1':
|
||||||
case '2':
|
case '2':
|
||||||
|
25
sh.h
25
sh.h
@ -175,7 +175,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.822 2017/04/28 01:15:51 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.823 2017/04/28 02:24:58 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R55 2017/04/27"
|
#define MKSH_VERSION "R55 2017/04/27"
|
||||||
|
|
||||||
@ -257,6 +257,21 @@ typedef MKSH_TYPEDEF_SSIZE_T ssize_t;
|
|||||||
|
|
||||||
#ifndef MKSH_INCLUDES_ONLY
|
#ifndef MKSH_INCLUDES_ONLY
|
||||||
|
|
||||||
|
/* EBCDIC fun */
|
||||||
|
|
||||||
|
#if defined(MKSH_FOR_Z_OS) && defined(__MVS__) && defined(__IBMC__) && defined(__CHARSET_LIB)
|
||||||
|
# if !__CHARSET_LIB && !defined(MKSH_EBCDIC)
|
||||||
|
# error "Please compile with Build.sh -E for EBCDIC!"
|
||||||
|
# endif
|
||||||
|
# if __CHARSET_LIB && defined(MKSH_EBCDIC)
|
||||||
|
# error "Please compile without -E argument to Build.sh for ASCII!"
|
||||||
|
# endif
|
||||||
|
# if __CHARSET_LIB && !defined(_ENHANCED_ASCII_EXT)
|
||||||
|
/* go all-out on ASCII */
|
||||||
|
# define _ENHANCED_ASCII_EXT 0xFFFFFFFF
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* extra types */
|
/* extra types */
|
||||||
|
|
||||||
/* getrusage does not exist on OS/2 kLIBC */
|
/* getrusage does not exist on OS/2 kLIBC */
|
||||||
@ -349,6 +364,8 @@ struct rusage {
|
|||||||
#define ksh_NSIG (_SIGMAX + 1)
|
#define ksh_NSIG (_SIGMAX + 1)
|
||||||
#elif defined(NSIG_MAX)
|
#elif defined(NSIG_MAX)
|
||||||
#define ksh_NSIG (NSIG_MAX)
|
#define ksh_NSIG (NSIG_MAX)
|
||||||
|
#elif defined(MKSH_FOR_Z_OS)
|
||||||
|
#define ksh_NSIG 40
|
||||||
#else
|
#else
|
||||||
# error Please have your platform define NSIG.
|
# error Please have your platform define NSIG.
|
||||||
#endif
|
#endif
|
||||||
@ -489,6 +506,9 @@ extern int __cdecl setegid(gid_t);
|
|||||||
|
|
||||||
#ifdef MKSH_EBCDIC
|
#ifdef MKSH_EBCDIC
|
||||||
#define KSH_BEL '\a'
|
#define KSH_BEL '\a'
|
||||||
|
#define KSH_ESC 047
|
||||||
|
#define KSH_ESC_STRING "\047"
|
||||||
|
#define KSH_VTAB '\v'
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* According to the comments in pdksh, \007 seems to be more portable
|
* According to the comments in pdksh, \007 seems to be more portable
|
||||||
@ -496,6 +516,9 @@ extern int __cdecl setegid(gid_t);
|
|||||||
* sequence if ASCII can be assumed.
|
* sequence if ASCII can be assumed.
|
||||||
*/
|
*/
|
||||||
#define KSH_BEL 7
|
#define KSH_BEL 7
|
||||||
|
#define KSH_ESC 033
|
||||||
|
#define KSH_ESC_STRING "\033"
|
||||||
|
#define KSH_VTAB 11
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user