* make 64-bit clean on GNU/Linux by default

* clean up and remove some .Xr from the man page
* bump version
This commit is contained in:
tg 2005-08-21 13:02:17 +00:00
parent 049c867c7d
commit 309b8d635f
6 changed files with 44 additions and 59 deletions

View File

@ -1,18 +1,12 @@
#!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.16 2005/07/07 23:27:52 tg Exp $
# $MirOS: src/bin/mksh/Build.sh,v 1.17 2005/08/21 13:02:16 tg Exp $
#-
# Recognised environment variables and their defaults:
# CC gcc
# CFLAGS -O2 -fno-strict-aliasing -fno-strength-reduce
# CPPFLAGS (empty)
# LDFLAGS -static
# LIBS (empty)
# NROFF nroff # (ignored if -r option given)
# GNU/Linux, Mac, Solaris: add -d, CPPFLAGS='-D_FILE_OFFSET_BITS=64'
# This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and
# NROFF. Add -d for dynamic linkage (on Mac, GNU/Linux and Solaris).
SHELL="${SHELL:-/bin/sh}"
CC="${CC:-gcc}"
CFLAGS="${CFLAGS--O2 -fno-strict-aliasing -fno-strength-reduce}"
CFLAGS="${CFLAGS--O2 -fno-strict-aliasing -fno-strength-reduce -Wall -D_FILE_OFFSET_BITS=64}"
export SHELL CC
srcdir="${srcdir:-`dirname "$0"`}"
curdir="`pwd`"
@ -23,7 +17,7 @@ r=0
LDSTATIC=-static
while [ -n "$1" ]; do
case "$1" in
case $1 in
-d)
LDSTATIC=
;;

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.27 2005/08/02 12:35:25 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.28 2005/08/21 13:02:16 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -3701,5 +3701,5 @@ category: pdksh
stdin:
echo $KSH_VERSION
expected-stdout:
@(#)MIRBSD KSH R24 2005/08/02
@(#)MIRBSD KSH R24 2005/08/21
---

View File

@ -1,6 +1,6 @@
$MirOS: src/bin/mksh/copyright,v 1.3 2005/07/05 21:32:42 tg Exp $
$MirOS: src/bin/mksh/copyright,v 1.4 2005/08/21 13:02:16 tg Exp $
mirbsdksh is a collective work under the following licence:
mksh is a collective work under the following licence:
/*-
* Copyright (c) 2002, 2003, 2004, 2005

66
edit.c
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/edit.c,v 1.12 2005/08/02 12:35:26 tg Exp $ */
/** $MirOS: src/bin/mksh/edit.c,v 1.13 2005/08/21 13:02:17 tg Exp $ */
/* $OpenBSD: edit.c,v 1.29 2005/04/13 02:33:08 deraadt Exp $ */
/* $OpenBSD: edit.h,v 1.8 2005/03/28 21:28:22 deraadt Exp $ */
/* $OpenBSD: emacs.c,v 1.38 2005/08/01 04:27:31 deraadt Exp $ */
@ -10,9 +10,7 @@
#include <ctype.h>
#include <libgen.h>
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.12 2005/08/02 12:35:26 tg Exp $");
#define BEL 0x07
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.13 2005/08/21 13:02:17 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -1333,7 +1331,7 @@ x_insert(int c)
* Should allow tab and control chars.
*/
if (c == 0) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
str[0] = c;
@ -1347,7 +1345,7 @@ static int
x_ins_string(int c)
{
if (macroptr) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
macroptr = x_atab[c >> 8][c & CHARMASK];
@ -1364,7 +1362,7 @@ static int
x_do_ins(const char *cp, int len)
{
if (xep + len >= xend) {
x_e_putc(BEL);
x_e_putc(7);
return -1;
}
memmove(xcp + len, xcp, xep - xcp + 1);
@ -1418,7 +1416,7 @@ x_del_back(int c __attribute__((unused)))
int col = xcp - xbuf;
if (col == 0) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
if (x_arg > col)
@ -1434,7 +1432,7 @@ x_del_char(int c __attribute__((unused)))
int nleft = xep - xcp;
if (!nleft) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
if (x_arg > nleft)
@ -1532,7 +1530,7 @@ x_bword(void)
char *cp = xcp;
if (cp == xbuf) {
x_e_putc(BEL);
x_e_putc(7);
return 0;
}
while (x_arg--) {
@ -1556,7 +1554,7 @@ x_fword(void)
char *cp = xcp;
if (cp == xep) {
x_e_putc(BEL);
x_e_putc(7);
return 0;
}
while (x_arg--) {
@ -1646,7 +1644,7 @@ x_mv_back(int c __attribute__((unused)))
int col = xcp - xbuf;
if (col == 0) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
if (x_arg > col)
@ -1661,7 +1659,7 @@ x_mv_forw(int c __attribute__((unused)))
int nleft = xep - xcp;
if (!nleft) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
if (x_arg > nleft)
@ -1681,7 +1679,7 @@ x_search_char_forw(int c)
if (c < 0 ||
((cp = (cp == xep) ? NULL : strchr(cp + 1, c)) == NULL &&
(cp = strchr(xbuf, c)) == NULL)) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
}
@ -1700,7 +1698,7 @@ x_search_char_back(int c)
if (p-- == xbuf)
p = xep;
if (c < 0 || p == cp) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
if (*p == c)
@ -1778,7 +1776,7 @@ x_load_hist(char **hp)
int oldsize;
if (hp < history || hp > histptr) {
x_e_putc(BEL);
x_e_putc(7);
return;
}
x_histp = hp;
@ -1848,7 +1846,7 @@ x_search_hist(int c)
/* add char to pattern */
/* overflow check... */
if (p >= &pat[sizeof(pat) - 1]) {
x_e_putc(BEL);
x_e_putc(7);
continue;
}
*p++ = c, *p = '\0';
@ -1889,7 +1887,7 @@ x_search(char *pat, int sameline, int offset)
return i;
}
}
x_e_putc(BEL);
x_e_putc(7);
x_histp = histptr;
return -1;
}
@ -2018,11 +2016,11 @@ x_transpose(int c __attribute__((unused)))
* to the one they want.
*/
if (xcp == xbuf) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
} else if (xcp == xep || Flag(FGMACS)) {
if (xcp - xbuf == 1) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
/* Gosling/Unipress emacs style: Swap two characters before the
@ -2157,7 +2155,7 @@ x_abort(int c __attribute__((unused)))
static int
x_error(int c __attribute__((unused)))
{
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
@ -2397,7 +2395,7 @@ x_kill_region(int c __attribute__((unused)))
char *xr;
if (xmp == NULL) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
if (xmp > xcp) {
@ -2419,7 +2417,7 @@ x_xchg_point_mark(int c __attribute__((unused)))
char *tmp;
if (xmp == NULL) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
tmp = xmp;
@ -2499,7 +2497,7 @@ x_expand(int c __attribute__((unused)))
&start, &end, &words, &is_command);
if (nwords == 0) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
x_goto(xbuf + start);
@ -2507,7 +2505,7 @@ x_expand(int c __attribute__((unused)))
for (i = 0; i < nwords;) {
if (x_escape(words[i], strlen(words[i]), x_emacs_putbuf) < 0 ||
(++i < nwords && x_ins(space) < 0)) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
}
@ -2531,7 +2529,7 @@ do_complete(int flags, /* XCF_{COMMAND,FILE,COMMAND_FILE} */
&start, &end, &words, &is_command);
/* no match */
if (nwords == 0) {
x_e_putc(BEL);
x_e_putc(7);
return;
}
if (type == CT_LIST) {
@ -2629,7 +2627,7 @@ x_e_putc(int c)
if (x_col < xx_cols) {
x_putc(c);
switch (c) {
case BEL:
case 7:
break;
case '\r':
case '\n':
@ -2675,7 +2673,7 @@ x_set_arg(int c)
for (; c >= 0 && isdigit(c); c = x_e_getc(), first = 0)
n = n * 10 + (c - '0');
if (c < 0 || first) {
x_e_putc(BEL);
x_e_putc(7);
x_arg = 1;
x_arg_defaulted = 1;
} else {
@ -2696,7 +2694,7 @@ x_comment(int c __attribute__((unused)))
int ret = x_do_comment(xbuf, xend - xbuf, &len);
if (ret < 0)
x_e_putc(BEL);
x_e_putc(7);
else {
xep = xbuf + len;
*xep = '\0';
@ -2732,7 +2730,7 @@ x_prev_histword(int c __attribute__((unused)))
cp = *histptr;
if (!cp)
x_e_putc(BEL);
x_e_putc(7);
else if (x_arg_defaulted) {
rcp = &cp[strlen(cp) - 1];
/*
@ -2809,7 +2807,7 @@ x_fold_case(int c)
char *cp = xcp;
if (cp == xep) {
x_e_putc(BEL);
x_e_putc(7);
return KSTD;
}
while (x_arg--) {
@ -3427,10 +3425,8 @@ vi_insert(int ch)
else
es->cbuf[es->cursor] = undo->cbuf[es->cursor];
} else {
if (es->cursor == 0) {
/* x_putc(BEL); no annoying bell here */
if (es->cursor == 0)
return 0;
}
if (inslen > 0)
inslen--;
es->cursor--;
@ -4965,7 +4961,7 @@ vi_error(void)
{
/* Beem out of any macros as soon as an error occurs */
vi_macro_reset();
x_putc(BEL);
x_putc(7);
x_flush();
}

6
main.c
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/main.c,v 1.23 2005/08/02 12:35:26 tg Exp $ */
/** $MirOS: src/bin/mksh/main.c,v 1.24 2005/08/21 13:02:17 tg Exp $ */
/* $OpenBSD: main.c,v 1.38 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: tty.c,v 1.8 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: io.c,v 1.21 2005/03/30 17:16:37 deraadt Exp $ */
@ -13,9 +13,9 @@
#include <time.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.23 2005/08/02 12:35:26 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.24 2005/08/21 13:02:17 tg Exp $");
#define MKSH_VERSION "@(#)MIRBSD KSH R24 2005/08/02"
#define MKSH_VERSION "@(#)MIRBSD KSH R24 2005/08/21"
extern char **environ;

7
mksh.1
View File

@ -1,4 +1,4 @@
.\" $MirOS: src/bin/mksh/mksh.1,v 1.15 2005/08/02 12:35:26 tg Exp $
.\" $MirOS: src/bin/mksh/mksh.1,v 1.16 2005/08/21 13:02:17 tg Exp $
.\" $OpenBSD: ksh.1,v 1.101 2005/08/01 19:29:57 jmc Exp $
.\" $OpenBSD: sh.1tbl,v 1.53 2004/12/10 01:56:56 jaredy Exp $
.\"
@ -5070,15 +5070,12 @@ Shell database.
.Sh SEE ALSO
.Xr arc4random 1 ,
.Xr awk 1 ,
.Xr csh 1 ,
.Xr ed 1 ,
.Xr mg 1 ,
.Xr getconf 1 ,
.Xr getopt 1 ,
.Xr sed 1 ,
.Xr sh 1 ,
.Xr stty 1 ,
.Xr vi 1 ,
.Xr dup 2 ,
.Xr execve 2 ,
.Xr getgid 2 ,
@ -5088,10 +5085,8 @@ Shell database.
.Xr wait 2 ,
.Xr getopt 3 ,
.Xr rand 3 ,
.Xr random 3 ,
.Xr signal 3 ,
.Xr srand 3 ,
.Xr srandom 3 ,
.Xr system 3 ,
.Xr tty 4 ,
.Xr shells 5 ,