Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/ksh Remove os2 support in ksh(1)
details: https://anonhg.NetBSD.org/src/rev/03952a261312
branches: trunk
changeset: 354589:03952a261312
user: kamil <kamil%NetBSD.org@localhost>
date: Thu Jun 22 13:33:39 2017 +0000
description:
Remove os2 support in ksh(1)
OK by <kre>
diffstat:
bin/ksh/c_ksh.c | 29 +---------
bin/ksh/c_sh.c | 15 +----
bin/ksh/config.h | 5 +-
bin/ksh/edit.c | 9 +--
bin/ksh/emacs.c | 53 +------------------
bin/ksh/eval.c | 17 +-----
bin/ksh/exec.c | 150 +----------------------------------------------------
bin/ksh/history.c | 8 +--
bin/ksh/io.c | 20 +------
bin/ksh/jobs.c | 8 +--
bin/ksh/lex.c | 10 +--
bin/ksh/main.c | 74 +-------------------------
bin/ksh/misc.c | 8 +--
bin/ksh/path.c | 13 +---
bin/ksh/sh.h | 40 +-------------
bin/ksh/shf.c | 11 +---
bin/ksh/tree.h | 5 +-
bin/ksh/vi.c | 31 +----------
18 files changed, 38 insertions(+), 468 deletions(-)
diffs (truncated from 1158 to 300 lines):
diff -r 0ffb0cd7d46e -r 03952a261312 bin/ksh/c_ksh.c
--- a/bin/ksh/c_ksh.c Thu Jun 22 13:32:47 2017 +0000
+++ b/bin/ksh/c_ksh.c Thu Jun 22 13:33:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $ */
+/* $NetBSD: c_ksh.c,v 1.20 2017/06/22 13:33:39 kamil Exp $ */
/*
* built-in Korn commands: c_*
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.20 2017/06/22 13:33:39 kamil Exp $");
#endif
#include "sh.h"
@@ -141,15 +141,7 @@
setstr(oldpwd_s, current_wd, KSH_RETURN_ERROR);
if (!ISABSPATH(Xstring(xs, xp))) {
-#ifdef OS2
- /* simplify_path() doesn't know about os/2's drive contexts,
- * so it can't set current_wd when changing to a:foo.
- * Handle this by calling getcwd()...
- */
- pwd = ksh_get_wd((char *) 0, 0);
-#else /* OS2 */
pwd = (char *) 0;
-#endif /* OS2 */
} else
#ifdef S_ISLNK
if (!physical || !(pwd = get_phys_path(Xstring(xs, xp))))
@@ -232,7 +224,6 @@
#define PO_PMINUSMINUS BIT(2) /* print a -- argument */
#define PO_HIST BIT(3) /* print to history instead of stdout */
#define PO_COPROC BIT(4) /* printing to coprocess: block SIGPIPE */
-#define PO_FSLASH BIT(5) /* swap slash for backslash (for os2 ) */
int fd = 1;
int flags = PO_EXPAND|PO_NL;
char *s;
@@ -273,11 +264,7 @@
}
} else {
int optc;
-#if OS2
- const char *options = "Rnpfrsu,"; /* added f flag */
-#else
const char *options = "Rnprsu,";
-#endif
while ((optc = ksh_getopt(wp, &builtin_opt, options)) != EOF)
switch (optc) {
case 'R': /* fake BSD echo command */
@@ -288,11 +275,6 @@
case 'e':
flags |= PO_EXPAND;
break;
-#ifdef OS2
- case 'f':
- flags |= PO_FSLASH;
- break;
-#endif
case 'n':
flags &= ~PO_NL;
break;
@@ -338,13 +320,6 @@
s = *wp;
while ((c = *s++) != '\0') {
Xcheck(xs, xp);
-#ifdef OS2
- if ((flags & PO_FSLASH) && c == '\\')
- if (*s == '\\')
- *s++;
- else
- c = '/';
-#endif /* OS2 */
if ((flags & PO_EXPAND) && c == '\\') {
int i;
diff -r 0ffb0cd7d46e -r 03952a261312 bin/ksh/c_sh.c
--- a/bin/ksh/c_sh.c Thu Jun 22 13:32:47 2017 +0000
+++ b/bin/ksh/c_sh.c Thu Jun 22 13:33:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c_sh.c,v 1.16 2016/10/11 06:31:07 dholland Exp $ */
+/* $NetBSD: c_sh.c,v 1.17 2017/06/22 13:33:39 kamil Exp $ */
/*
* built-in Bourne commands
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.16 2016/10/11 06:31:07 dholland Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.17 2017/06/22 13:33:39 kamil Exp $");
#endif
@@ -331,9 +331,6 @@
while (1) {
c = shf_getc(shf);
if (c == '\0'
-#ifdef OS2
- || c == '\r'
-#endif /* OS2 */
)
continue;
if (c == EOF && shf_error(shf)
@@ -905,13 +902,5 @@
{"ulimit", c_ulimit},
{"+umask", c_umask},
{"*=unset", c_unset},
-#ifdef OS2
- /* In OS2, the first line of a file can be "extproc name", which
- * tells the command interpreter (cmd.exe) to use name to execute
- * the file. For this to be useful, ksh must ignore commands
- * starting with extproc and this does the trick...
- */
- {"extproc", c_label},
-#endif /* OS2 */
{NULL, NULL}
};
diff -r 0ffb0cd7d46e -r 03952a261312 bin/ksh/config.h
--- a/bin/ksh/config.h Thu Jun 22 13:32:47 2017 +0000
+++ b/bin/ksh/config.h Thu Jun 22 13:33:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h,v 1.8 2004/08/19 23:00:22 christos Exp $ */
+/* $NetBSD: config.h,v 1.9 2017/06/22 13:33:39 kamil Exp $ */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
@@ -184,9 +184,6 @@
/* Define if you arg running ISC unix */
/* #undef OS_ISC */
-/* Define if you arg running OS2 with the EMX library */
-/* #undef OS2 */
-
/* Define if you have a POSIX.1 compatible <sys/wait.h> */
#define POSIX_SYS_WAIT 1
diff -r 0ffb0cd7d46e -r 03952a261312 bin/ksh/edit.c
--- a/bin/ksh/edit.c Thu Jun 22 13:32:47 2017 +0000
+++ b/bin/ksh/edit.c Thu Jun 22 13:33:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: edit.c,v 1.26 2017/06/22 13:32:04 kamil Exp $ */
+/* $NetBSD: edit.c,v 1.27 2017/06/22 13:33:39 kamil Exp $ */
/*
* Command line editing - common code
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.26 2017/06/22 13:32:04 kamil Exp $");
+__RCSID("$NetBSD: edit.c,v 1.27 2017/06/22 13:33:39 kamil Exp $");
#endif
@@ -161,10 +161,6 @@
int
x_getc()
{
-#ifdef OS2
- unsigned char c = _read_kbd(0, 1, 0);
- return c == 0 ? 0xE0 : c;
-#else /* OS2 */
char c;
int n;
@@ -177,7 +173,6 @@
if (n != 1)
return -1;
return (int) (unsigned char) c;
-#endif /* OS2 */
}
void
diff -r 0ffb0cd7d46e -r 03952a261312 bin/ksh/emacs.c
--- a/bin/ksh/emacs.c Thu Jun 22 13:32:47 2017 +0000
+++ b/bin/ksh/emacs.c Thu Jun 22 13:33:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.32 2009/04/25 05:11:37 lukem Exp $ */
+/* $NetBSD: emacs.c,v 1.33 2017/06/22 13:33:39 kamil Exp $ */
/*
* Emacs-like command line editing and history
@@ -10,7 +10,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: emacs.c,v 1.32 2009/04/25 05:11:37 lukem Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.33 2017/06/22 13:33:39 kamil Exp $");
#endif
@@ -62,17 +62,8 @@
#define is_cfs(c) (c == ' ' || c == '\t' || c == '"' || c == '\'')
#define is_mfs(c) (!(isalnum((unsigned char)c) || c == '_' || c == '$')) /* Separator for motion */
-#ifdef OS2
- /* Deal with 8 bit chars & an extra prefix for function key (these two
- * changes increase memory usage from 9,216 bytes to 24,416 bytes...)
- */
-# define CHARMASK 0xFF /* 8-bit ASCII character mask */
-# define X_NTABS 4 /* normal, meta1, meta2, meta3 */
-static int x_prefix3 = 0xE0;
-#else /* OS2 */
# define CHARMASK 0xFF /* 8-bit character mask */
# define X_NTABS 3 /* normal, meta1, meta2 */
-#endif /* OS2 */
#define X_TABSZ (CHARMASK+1) /* size of keydef tables etc */
/* Arguments for do_complete()
@@ -234,9 +225,6 @@
#else
{ 0, 0, 0 },
#endif
-#ifdef OS2
- { x_meta3, "prefix-3", XF_PREFIX },
-#else
{ 0, 0, 0 },
#endif
/* @END-FUNC-TAB@ */
@@ -316,13 +304,6 @@
{ XFUNC_fold_lower, 1, 'l' },
{ XFUNC_fold_capitalize, 1, 'C' },
{ XFUNC_fold_capitalize, 1, 'c' },
-#ifdef OS2
- { XFUNC_meta3, 0, 0xE0 },
- { XFUNC_mv_back, 3, 'K' },
- { XFUNC_mv_forw, 3, 'M' },
- { XFUNC_next_com, 3, 'P' },
- { XFUNC_prev_com, 3, 'H' },
-#endif /* OS2 */
/* These for ansi arrow keys: arguablely shouldn't be here by
* default, but its simpler/faster/smaller than using termcap
* entries.
@@ -1209,16 +1190,6 @@
return KSTD;
}
-#ifdef OS2
-static int
-x_meta3(c)
- int c;
-{
- x_curprefix = 3;
- return KSTD;
-}
-#endif /* OS2 */
-
static int
x_kill(c)
int c;
@@ -1358,11 +1329,6 @@
/* XXX -- should handle \^ escape? */
if (*cp == '^') {
cp++;
-#ifdef OS2
- if (*cp == '0') /* To define function keys */
- *op++ = 0xE0;
- else
-#endif /* OS2 */
if (*cp >= '?') /* includes '?'; ASCII */
*op++ = CTRL(*cp);
else {
@@ -1385,12 +1351,6 @@
static char buf[8];
register char *p = buf;
-#ifdef OS2
- if (c == 0xE0) {
- *p++ = '^';
- *p++ = '0';
- } else
-#endif /* OS2 */
if (iscntrl((unsigned char)c)) {
*p++ = '^';
*p++ = UNCTRL(c);
@@ -1408,10 +1368,7 @@
shprintf("%s", x_mapout(x_prefix1));
if (prefix == 2)
shprintf("%s", x_mapout(x_prefix2));
-#ifdef OS2
- if (prefix == 3)
- shprintf("%s", x_mapout(x_prefix3));
-#endif /* OS2 */
+
shprintf("%s = ", x_mapout(key));
if (x_tab[prefix][key] != XFUNC_ins_string)
shprintf("%s\n", x_ftab[x_tab[prefix][key]].xf_name);
@@ -1464,10 +1421,6 @@
prefix = 1;
else if (x_tab[prefix][key] == XFUNC_meta2)
prefix = 2;
-#ifdef OS2
- else if (x_tab[prefix][key] == XFUNC_meta3)
- prefix = 3;
-#endif /* OS2 */
Home |
Main Index |
Thread Index |
Old Index