Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/ksh Reapply removal of code from 90ties for OS/2 Cygwin ...
details: https://anonhg.NetBSD.org/src/rev/fc5b7a424d99
branches: trunk
changeset: 354596:fc5b7a424d99
user: kamil <kamil%NetBSD.org@localhost>
date: Thu Jun 22 14:20:46 2017 +0000
description:
Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix
Added missing #endif terminator in emacs.c
diffstat:
bin/ksh/c_ksh.c | 40 +-------------
bin/ksh/c_sh.c | 15 +----
bin/ksh/c_ulimit.c | 7 +-
bin/ksh/config.h | 19 +------
bin/ksh/edit.c | 18 +-----
bin/ksh/emacs.c | 54 +------------------
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 | 33 +----------
bin/ksh/path.c | 19 +------
bin/ksh/sh.h | 49 +----------------
bin/ksh/shf.c | 11 +---
bin/ksh/trap.c | 7 +-
bin/ksh/tree.h | 5 +-
bin/ksh/vi.c | 31 +----------
20 files changed, 43 insertions(+), 552 deletions(-)
diffs (truncated from 1370 to 300 lines):
diff -r 8772e1f95c06 -r fc5b7a424d99 bin/ksh/c_ksh.c
--- a/bin/ksh/c_ksh.c Thu Jun 22 14:11:27 2017 +0000
+++ b/bin/ksh/c_ksh.c Thu Jun 22 14:20:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c_ksh.c,v 1.22 2017/06/22 14:11:27 kamil Exp $ */
+/* $NetBSD: c_ksh.c,v 1.23 2017/06/22 14:20:46 kamil Exp $ */
/*
* built-in Korn commands: c_*
@@ -6,17 +6,13 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.22 2017/06/22 14:11:27 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.23 2017/06/22 14:20:46 kamil Exp $");
#endif
#include "sh.h"
#include "ksh_stat.h"
#include <ctype.h>
-#ifdef __CYGWIN__
-#include <sys/cygwin.h>
-#endif /* __CYGWIN__ */
-
int
c_cd(wp)
char **wp;
@@ -145,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))))
@@ -162,12 +150,7 @@
/* Set PWD */
if (pwd) {
-#ifdef __CYGWIN__
- char ptmp[PATH]; /* larger than MAX_PATH */
- cygwin_conv_to_full_posix_path(pwd, ptmp);
-#else /* __CYGWIN__ */
char *ptmp = pwd;
-#endif /* __CYGWIN__ */
set_current_wd(ptmp);
/* Ignore failure (happens if readonly or integer) */
setstr(pwd_s, ptmp, KSH_RETURN_ERROR);
@@ -241,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;
@@ -282,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 */
@@ -297,11 +275,6 @@
case 'e':
flags |= PO_EXPAND;
break;
-#ifdef OS2
- case 'f':
- flags |= PO_FSLASH;
- break;
-#endif
case 'n':
flags &= ~PO_NL;
break;
@@ -347,19 +320,12 @@
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;
switch ((c = *s++)) {
/* Oddly enough, \007 seems more portable than
- * \a (due to HP-UX cc, Ultrix cc, old pcc's,
+ * \a (due to Ultrix cc, old pcc's,
* etc.).
*/
case 'a': c = '\007'; break;
diff -r 8772e1f95c06 -r fc5b7a424d99 bin/ksh/c_sh.c
--- a/bin/ksh/c_sh.c Thu Jun 22 14:11:27 2017 +0000
+++ b/bin/ksh/c_sh.c Thu Jun 22 14:20:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c_sh.c,v 1.18 2017/06/22 14:11:27 kamil Exp $ */
+/* $NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $ */
/*
* built-in Bourne commands
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.18 2017/06/22 14:11:27 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 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 8772e1f95c06 -r fc5b7a424d99 bin/ksh/c_ulimit.c
--- a/bin/ksh/c_ulimit.c Thu Jun 22 14:11:27 2017 +0000
+++ b/bin/ksh/c_ulimit.c Thu Jun 22 14:20:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c_ulimit.c,v 1.14 2017/06/22 14:11:27 kamil Exp $ */
+/* $NetBSD: c_ulimit.c,v 1.15 2017/06/22 14:20:46 kamil Exp $ */
/*
ulimit -- handle "ulimit" builtin
@@ -20,7 +20,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_ulimit.c,v 1.14 2017/06/22 14:11:27 kamil Exp $");
+__RCSID("$NetBSD: c_ulimit.c,v 1.15 2017/06/22 14:20:46 kamil Exp $");
#endif
@@ -113,9 +113,6 @@
# ifdef UL_GETBREAK /* osf/1 */
{ "vmemory(maxaddr)", ULIMIT, UL_GETBREAK, -1, 1, 'v' },
# else /* UL_GETBREAK */
-# ifdef UL_GETMAXBRK /* hpux */
- { "vmemory(maxaddr)", ULIMIT, UL_GETMAXBRK, -1, 1, 'v' },
-# endif /* UL_GETMAXBRK */
# endif /* UL_GETBREAK */
# endif /* UL_GMEMLIM */
#endif /* RLIMIT_VMEM */
diff -r 8772e1f95c06 -r fc5b7a424d99 bin/ksh/config.h
--- a/bin/ksh/config.h Thu Jun 22 14:11:27 2017 +0000
+++ b/bin/ksh/config.h Thu Jun 22 14:20:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h,v 1.13 2017/06/22 14:11:27 kamil Exp $ */
+/* $NetBSD: config.h,v 1.14 2017/06/22 14:20:46 kamil Exp $ */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
@@ -11,13 +11,6 @@
#ifndef CONFIG_H
#define CONFIG_H
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
@@ -178,15 +171,9 @@
/* Define if the pgrp of setpgrp() can't be the pid of a zombie process */
/* #undef NEED_PGRP_SYNC */
-/* Define if you arg running SCO unix */
-/* #undef OS_SCO */
-
/* 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
@@ -200,10 +187,6 @@
#define DEFAULT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
#endif
-/* Define if your C library's getwd/getcwd function dumps core in unreadable
- * directories. */
-/* #undef HPUX_GETWD_BUG */
-
/* Include ksh features? */
#define KSH 1
diff -r 8772e1f95c06 -r fc5b7a424d99 bin/ksh/edit.c
--- a/bin/ksh/edit.c Thu Jun 22 14:11:27 2017 +0000
+++ b/bin/ksh/edit.c Thu Jun 22 14:20:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: edit.c,v 1.29 2017/06/22 14:11:27 kamil Exp $ */
+/* $NetBSD: edit.c,v 1.30 2017/06/22 14:20:46 kamil Exp $ */
/*
* Command line editing - common code
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.29 2017/06/22 14:11:27 kamil Exp $");
+__RCSID("$NetBSD: edit.c,v 1.30 2017/06/22 14:20:46 kamil Exp $");
#endif
@@ -19,10 +19,6 @@
#define EXTERN
#include "edit.h"
#undef EXTERN
-#ifdef OS_SCO /* SCO Unix 3.2v4.1 */
-# include <sys/stream.h> /* needed for <sys/ptem.h> */
-# include <sys/ptem.h> /* needed for struct winsize */
-#endif /* OS_SCO */
#include <sys/ioctl.h>
#include <ctype.h>
#include "ksh_stat.h"
@@ -161,10 +157,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 +169,6 @@
if (n != 1)
return -1;
return (int) (unsigned char) c;
-#endif /* OS2 */
}
void
@@ -293,11 +284,6 @@
set_tty(tty_fd, &cb, TF_WAIT);
-#ifdef __CYGWIN__
- if (edchars.eof == '\0')
- edchars.eof = '\4';
-#endif /* __CYGWIN__ */
-
/* Convert unset values to internal `unset' value */
if (edchars.erase == vdisable_c)
edchars.erase = -1;
diff -r 8772e1f95c06 -r fc5b7a424d99 bin/ksh/emacs.c
--- a/bin/ksh/emacs.c Thu Jun 22 14:11:27 2017 +0000
+++ b/bin/ksh/emacs.c Thu Jun 22 14:20:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.34 2017/06/22 14:11:27 kamil Exp $ */
+/* $NetBSD: emacs.c,v 1.35 2017/06/22 14:20:46 kamil Exp $ */
/*
* Emacs-like command line editing and history
@@ -10,7 +10,7 @@
Home |
Main Index |
Thread Index |
Old Index