From 69378989142c4b33665fd5d80bc06b4d2b1a5c34 Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 18 Jul 2003 13:10:02 +0000 Subject: [PATCH 1/3] Synchronize source tree with OpenBSD note: due to recent changes in the codebase of OpenBSD, out libcom_err will be incompatible with theirs... but this is no issue because we don't provide a dynamically linked one, and theirs won't be provided longer any more anyways. --- LEGAL | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/LEGAL b/LEGAL index d8325a3..78880a9 100644 --- a/LEGAL +++ b/LEGAL @@ -1,36 +1,12 @@ -$OpenBSD: LEGAL,v 1.1.1.1 1996/08/14 06:19:10 downsj Exp $ +$OpenBSD: LEGAL,v 1.2 2003/07/17 20:59:43 deraadt Exp $ pdksh is provided AS IS, with NO WARRANTY, either expressed or implied. The vast majority of the code that makes pdksh is in the public domain. The exceptions are: sigact.c and sigact.h - These are covered by copyrighten by Simon J. Gerraty; - the copyright notice for these files is as follows: - This is free software. It comes with NO WARRANTY. - Permission to use, modify and distribute this source code - is granted subject to the following conditions. - 1/ that that the above copyright notice and this notice - are preserved in all copies and that due credit be given - to the author. - 2/ that any changes to this code are clearly commented - as such so that the author does get blamed for bugs - other than his own. + [REMOVED] aclocal.m4 - This is covered by the GNU General Public Licence (GPL) - as it contains modified versions of macros that come with - GNU autoconf. As this is used solely for configuration, - the pdksh code itself is not covered by the GPL. - The following is taken from autoconf 2.x documentation - (info autoconf questions distributing) concerning use - of autoconf in programs: - - There are no restrictions on how the configuration - scripts that Autoconf produces may be distributed - or used. In Autoconf version 1, they were covered by - the GNU General Public License. We still encourage - software authors to distribute their work under terms - like those of the GPL, but doing so is not required - to use Autoconf. + [REMOVED] That's it. Short and simple. From ea72216cc5c38289a17aada237e351043f6d4e85 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 19 Jul 2003 18:20:50 +0000 Subject: [PATCH 2/3] Another sync to OpenBSD --- ksh.1tbl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ksh.1tbl b/ksh.1tbl index 38ffc40..2515609 100644 --- a/ksh.1tbl +++ b/ksh.1tbl @@ -1,4 +1,4 @@ -.\" $OpenBSD: ksh.1tbl,v 1.54 2003/07/07 14:11:58 jmc Exp $ +.\" $OpenBSD: ksh.1tbl,v 1.55 2003/07/19 08:07:35 jmc Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -4556,7 +4556,7 @@ The last word of the previous command is inserted at the cursor. .It Ic quote ^^ The following character is taken literally rather than as an editing command. -.It Ic redrew ^L +.It Ic redraw ^L Reprints the prompt string and the current input line. .It Ic search-character-backward Ar n Ic ^[^] Search backward in the current line for the From 1a61c101264e2f0c5a2dec2df8602d9bc279e5ea Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 11 Aug 2003 17:45:54 +0000 Subject: [PATCH 3/3] Import the complete OpenBSD source tree (base system) as of CTM delta 3496 (roughly 1200 UTC today) into the vendor branch. Attention: this is a big update. Don't even try to build this system, OpenBSD 3.4-beta, yet on your own. --- Makefile | 6 +++++- alloc.c | 23 ++++++++++++----------- emacs.c | 8 +++++--- lex.c | 4 ++-- misc.c | 8 +++----- var.c | 5 ++--- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index ae58403..2786d44 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2002/04/22 21:44:58 miod Exp $ +# $OpenBSD: Makefile,v 1.14 2003/08/08 22:32:10 miod Exp $ PROG= ksh SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c \ @@ -31,3 +31,7 @@ check test: /bin/sh ${.CURDIR}/tests/th.sh ${.CURDIR}/tests/th -s ${.CURDIR}/tests -p ./ksh -C pdksh,sh,ksh,posix,posix-upu .include + +.if (${MACHINE_ARCH} == "m88k") +CFLAGS+= -O0 +.endif diff --git a/alloc.c b/alloc.c index 19f9e86..09df76b 100644 --- a/alloc.c +++ b/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.5 2002/03/01 13:06:18 espie Exp $ */ +/* $OpenBSD: alloc.c,v 1.6 2003/08/05 20:52:27 millert Exp $ */ /* * Copyright (c) 2002 Marc Espie. * @@ -63,8 +63,8 @@ alloc(size_t size, Area *ap) struct link *l; l = malloc(size + sizeof(struct link)); - if (!l) - return NULL; + if (l == NULL) + internal_errorf(1, "unable to allocate memory"); l->next = ap->freelist; l->prev = NULL; if (ap->freelist) @@ -87,14 +87,15 @@ aresize(void *ptr, size_t size, Area *ap) lnext = l->next; l2 = realloc(l, size+sizeof(struct link)); - if (l2) { - if (lprev) - lprev->next = l2; - else - ap->freelist = l2; - if (lnext) - lnext->prev = l2; - } + if (l2 == NULL) + internal_errorf(1, "unable to allocate memory"); + if (lprev) + lprev->next = l2; + else + ap->freelist = l2; + if (lnext) + lnext->prev = l2; + return L2P(l2); } diff --git a/emacs.c b/emacs.c index 3ec71f0..451519b 100644 --- a/emacs.c +++ b/emacs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emacs.c,v 1.20 2003/06/26 00:09:45 deraadt Exp $ */ +/* $OpenBSD: emacs.c,v 1.22 2003/08/02 19:44:12 fgsch Exp $ */ /* * Emacs-like command line editing and history @@ -554,7 +554,7 @@ x_delete(nc, force_push) /* * This lets us yank a word we have deleted. */ - if (nc > 1 || force_push) + if (force_push) x_push(nc); xep -= nc; @@ -1264,7 +1264,9 @@ x_meta_yank(c) int c; { int len; - if (x_last_command != XFUNC_yank && x_last_command != XFUNC_meta_yank) { + if ((x_last_command != XFUNC_yank && x_last_command != XFUNC_meta_yank) + || killstack[killtp] == 0) { + killtp = killsp; x_e_puts("\nyank something first"); x_redraw(-1); return KSTD; diff --git a/lex.c b/lex.c index 11f0657..53e72b5 100644 --- a/lex.c +++ b/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.17 2003/02/28 09:45:09 jmc Exp $ */ +/* $OpenBSD: lex.c,v 1.18 2003/08/06 21:08:05 millert Exp $ */ /* * lexical analysis and source input @@ -1394,5 +1394,5 @@ pop_state_(si, old_end) afree(old_base, ATEMP); - return si->base + STATE_BSIZE - 1;; + return si->base + STATE_BSIZE - 1; } diff --git a/misc.c b/misc.c index dbbc222..832ad7f 100644 --- a/misc.c +++ b/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.16 2003/04/16 23:11:52 tdeval Exp $ */ +/* $OpenBSD: misc.c,v 1.18 2003/08/06 21:08:05 millert Exp $ */ /* * Miscellaneous functions @@ -90,8 +90,6 @@ str_save(s, ap) return NULL; len = strlen(s)+1; p = alloc(len, ap); - if (!p) - return NULL; strlcpy(p, s, len+1); return (p); } @@ -1051,13 +1049,13 @@ ksh_getopt(argv, go, options) go->optarg = argv[go->optind - 1] + go->p; go->p = 0; } else - go->optarg = (char *) 0;; + go->optarg = (char *) 0; } else { if (argv[go->optind] && digit(argv[go->optind][0])) { go->optarg = argv[go->optind++]; go->p = 0; } else - go->optarg = (char *) 0;; + go->optarg = (char *) 0; } } return c; diff --git a/var.c b/var.c index 400e4f6..8d3eacb 100644 --- a/var.c +++ b/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.15 2003/06/26 00:09:45 deraadt Exp $ */ +/* $OpenBSD: var.c,v 1.16 2003/08/05 20:52:27 millert Exp $ */ #include "sh.h" #include "ksh_time.h" @@ -385,8 +385,7 @@ setstr(vq, s, error_ok) export(vq, s); else { vq->val.s = str_save(s, vq->areap); - if (vq->val.s) /* don't lie */ - vq->flag |= ALLOC; + vq->flag |= ALLOC; } } else /* integer dest */ if (!v_evaluate(vq, s, error_ok))