diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
| commit | 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch) | |
| tree | e779b5a6edddbb949b7990751b12d6f25304ba86 /bin | |
| parent | a16f65c7d117419bd266c28a1901ef129a337569 (diff) | |
Release FreeBSD 1.1.5.1upstream/1.1.5.1_cvsrelease/1.1.5.1_cvsreleng/1
This commit was manufactured to restore the state of the 1.1.5.1-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/cp/cp.c | 4 | ||||
| -rw-r--r-- | bin/cp/path.c | 2 | ||||
| -rw-r--r-- | bin/csh/char.c | 4 | ||||
| -rw-r--r-- | bin/csh/char.h | 2 | ||||
| -rw-r--r-- | bin/csh/dol.c | 4 | ||||
| -rw-r--r-- | bin/csh/lex.c | 6 | ||||
| -rw-r--r-- | bin/df/df.c | 2 | ||||
| -rw-r--r-- | bin/ed/Makefile | 2 | ||||
| -rw-r--r-- | bin/ed/buf.c | 10 | ||||
| -rw-r--r-- | bin/ed/cbc.c | 2 | ||||
| -rw-r--r-- | bin/ed/ed.h | 17 | ||||
| -rw-r--r-- | bin/ed/glbl.c (renamed from bin/ed/glob.c) | 2 | ||||
| -rw-r--r-- | bin/ed/io.c | 2 | ||||
| -rw-r--r-- | bin/ed/main.c | 2 | ||||
| -rw-r--r-- | bin/ed/re.c | 2 | ||||
| -rw-r--r-- | bin/ed/sub.c | 2 | ||||
| -rw-r--r-- | bin/ed/undo.c | 2 | ||||
| -rw-r--r-- | bin/expr/expr.1 | 2 | ||||
| -rw-r--r-- | bin/ls/ls.1 | 2 | ||||
| -rw-r--r-- | bin/mkdir/mkdir.1 | 2 | ||||
| -rw-r--r-- | bin/mkdir/mkdir.c | 4 | ||||
| -rw-r--r-- | bin/mv/mv.c | 4 | ||||
| -rw-r--r-- | bin/rcp/Makefile | 10 | ||||
| -rw-r--r-- | bin/rm/rm.c | 2 | ||||
| -rw-r--r-- | bin/rmail/rmail.c | 1 | ||||
| -rw-r--r-- | bin/rmdir/rmdir.c | 4 | ||||
| -rw-r--r-- | bin/sh/builtins | 2 | ||||
| -rw-r--r-- | bin/sh/cd.c | 2 | ||||
| -rw-r--r-- | bin/sh/expand.c | 8 | ||||
| -rw-r--r-- | bin/sh/miscbltin.c | 4 | ||||
| -rw-r--r-- | bin/stty/cchar.c | 10 | ||||
| -rw-r--r-- | bin/stty/gfmt.c | 4 | ||||
| -rw-r--r-- | bin/stty/key.c | 2 | ||||
| -rw-r--r-- | bin/stty/print.c | 10 |
34 files changed, 74 insertions, 66 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c index e21bba631e9d..97375b17d1a1 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -299,7 +299,7 @@ copy_file(fs, dne) struct stat *fs; int dne; { - static char buf[MAXBSIZE]; + static char buf[MAXBSIZE * 4]; register int from_fd, to_fd, rcount, wcount; struct stat to_stat; char *p; @@ -358,7 +358,7 @@ copy_file(fs, dne) if (munmap((caddr_t) p, fs->st_size) < 0) err("%s: %s", from.p_path, strerror(errno)); } else { - while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) { + while ((rcount = read(from_fd, buf, sizeof(buf))) > 0) { wcount = write(to_fd, buf, rcount); if (rcount != wcount || wcount == -1) { err("%s: %s", to.p_path, strerror(errno)); diff --git a/bin/cp/path.c b/bin/cp/path.c index a84892193554..170460283522 100644 --- a/bin/cp/path.c +++ b/bin/cp/path.c @@ -50,7 +50,7 @@ static char sccsid[] = "@(#)path.c 5.2 (Berkeley) 10/27/91"; */ #define STRIP_TRAILING_SLASH(p) { \ - while ((p)->p_end > (p)->p_path && (p)->p_end[-1] == '/') \ + while ((p)->p_end > ((p)->p_path + 1) && (p)->p_end[-1] == '/') \ *--(p)->p_end = 0; \ } diff --git a/bin/csh/char.c b/bin/csh/char.c index f552a28684a5..eb2dab68bf10 100644 --- a/bin/csh/char.c +++ b/bin/csh/char.c @@ -63,10 +63,10 @@ unsigned short _cmap[256] = { _CTR, _CTR, _CTR, _CTR, /* sp ! " # */ - _SP|_META, 0, _Q, _META, + _SP|_META, 0, _Q2, _META, /* $ % & ' */ - _DOL, 0, _META|_CMD, _Q, + _DOL, 0, _META|_CMD, _Q2, /* ( ) * + */ _META|_CMD, _META, _GLOB, 0, diff --git a/bin/csh/char.h b/bin/csh/char.h index 297a6ee8e1e2..475436879180 100644 --- a/bin/csh/char.h +++ b/bin/csh/char.h @@ -42,7 +42,7 @@ extern unsigned char _cmap_lower[], _cmap_upper[]; #endif -#define _Q 0x0001 /* '" */ +#define _Q2 0x0001 /* '" */ #define _Q1 0x0002 /* ` */ #define _SP 0x0004 /* space and tab */ #define _NL 0x0008 /* \n */ diff --git a/bin/csh/dol.c b/bin/csh/dol.c index d2b28f5433b1..816b45840664 100644 --- a/bin/csh/dol.c +++ b/bin/csh/dol.c @@ -66,7 +66,7 @@ static Char *Dcp, **Dvp; /* Input vector for Dreadc */ #define unDgetC(c) Dpeekc = c -#define QUOTES (_Q|_Q1|_ESC) /* \ ' " ` */ +#define QUOTES (_Q2|_Q1|_ESC) /* \ ' " ` */ /* * The following variables give the information about the current @@ -192,7 +192,7 @@ Dpack(wbuf, wp) Gcat(STRNULL, wbuf); return (NULL); } - if (cmap(c, _SP | _NL | _Q | _Q1)) { /* sp \t\n'"` */ + if (cmap(c, _SP | _NL | _Q2 | _Q1)) { /* sp \t\n'"` */ unDgetC(c); if (cmap(c, QUOTES)) return (wp); diff --git a/bin/csh/lex.c b/bin/csh/lex.c index 63af5da774a4..75fb7e3a7f70 100644 --- a/bin/csh/lex.c +++ b/bin/csh/lex.c @@ -315,7 +315,7 @@ loop: break; } } - else if (cmap(c, _META | _Q | _Q1 | _ESC)) { + else if (cmap(c, _META | _Q2 | _Q1 | _ESC)) { if (c == '\\') { c = getC(0); if (c == '\n') { @@ -327,7 +327,7 @@ loop: *wp++ = '\\', --i; c |= QUOTE; } - else if (cmap(c, _Q | _Q1)) { /* '"` */ + else if (cmap(c, _Q2 | _Q1)) { /* '"` */ c1 = c; dolflg = c == '"' ? DOALL : DOEXCL; } @@ -366,7 +366,7 @@ getC1(flag) if ((c = *lap++) == 0) lap = 0; else { - if (cmap(c, _META | _Q | _Q1)) + if (cmap(c, _META | _Q2 | _Q1)) c |= QUOTE; return (c); } diff --git a/bin/df/df.c b/bin/df/df.c index a28a862cc09b..ecebfe85baac 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -5,7 +5,7 @@ * or UNIX System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * - * $Id: df.c,v 1.3.2.2 1994/05/04 07:35:01 rgrimes Exp $ + * $Id: df.c,v 1.5 1994/05/04 08:04:22 rgrimes Exp $ */ /* * Copyright (c) 1980, 1990 The Regents of the University of California. diff --git a/bin/ed/Makefile b/bin/ed/Makefile index a99763cc9202..7ecca79081d9 100644 --- a/bin/ed/Makefile +++ b/bin/ed/Makefile @@ -1,5 +1,5 @@ PROG= ed -SRCS= buf.c cbc.c glob.c io.c main.c re.c sub.c undo.c +SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 diff --git a/bin/ed/buf.c b/bin/ed/buf.c index f5b8045ebb3b..70275990c9ae 100644 --- a/bin/ed/buf.c +++ b/bin/ed/buf.c @@ -26,10 +26,11 @@ * SUCH DAMAGE. */ #ifndef lint -static char *rcsid = "@(#)$Id: buf.c,v 1.4 1994/02/01 00:34:35 alm Exp $"; +static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp"; #endif /* not lint */ #include <sys/file.h> +#include <sys/stat.h> #include "ed.h" @@ -131,7 +132,7 @@ add_line_node(lp) line_t *cp; cp = get_addressed_line_node(current_addr); /* this get_addressed_line_node last! */ - insque(lp, cp); + INSQUE(lp, cp); addr_last++; current_addr++; } @@ -195,13 +196,18 @@ char sfn[15] = ""; /* scratch file name */ int open_sbuf() { + int u; + isbinary = newline_added = 0; + u = umask(077); strcpy(sfn, "/tmp/ed.XXXXXX"); if (mktemp(sfn) == NULL || (sfp = fopen(sfn, "w+")) == NULL) { fprintf(stderr, "%s: %s\n", sfn, strerror(errno)); sprintf(errmsg, "cannot open temp file"); + umask(u); return ERR; } + umask(u); return 0; } diff --git a/bin/ed/cbc.c b/bin/ed/cbc.c index 9d1d9894583e..ee5285cdd0ec 100644 --- a/bin/ed/cbc.c +++ b/bin/ed/cbc.c @@ -38,7 +38,7 @@ */ #ifndef lint -static char *rcsid = "@(#)$Id: cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp $"; +static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp"; #endif /* not lint */ #include <sys/types.h> diff --git a/bin/ed/ed.h b/bin/ed/ed.h index 1f61428eb73a..dd638806c470 100644 --- a/bin/ed/ed.h +++ b/bin/ed/ed.h @@ -24,14 +24,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)$Id: ed.h,v 1.5 1994/02/01 00:34:39 alm Exp $ + * @(#)ed.h,v 1.5 1994/02/01 00:34:39 alm Exp */ +#include <sys/types.h> #if defined(BSD) && BSD >= 199103 || defined(__386BSD__) # include <sys/param.h> /* for MAXPATHLEN */ #endif #include <errno.h> -#ifdef sun +#if defined(sun) || defined(__NetBSD__) # include <limits.h> #endif #include <regex.h> @@ -166,17 +167,15 @@ if ((i) > (n)) { \ /* REQUE: link pred before succ */ #define REQUE(pred, succ) (pred)->q_forw = (succ), (succ)->q_back = (pred) -#ifdef NEED_INSQUE -/* insque: insert elem in circular queue after pred */ -#define insque(elem, pred) \ +/* INSQUE: insert elem in circular queue after pred */ +#define INSQUE(elem, pred) \ { \ REQUE((elem), (pred)->q_forw); \ REQUE((pred), elem); \ } -/* remque: remove_lines elem from circular queue */ -#define remque(elem) REQUE((elem)->q_back, (elem)->q_forw); -#endif /* NEED_INSQUE */ +/* REMQUE: remove_lines elem from circular queue */ +#define REMQUE(elem) REQUE((elem)->q_back, (elem)->q_forw); /* NUL_TO_NEWLINE: overwrite ASCII NULs with newlines */ #define NUL_TO_NEWLINE(s, l) translit_text(s, l, '\0', '\n') @@ -184,7 +183,7 @@ if ((i) > (n)) { \ /* NEWLINE_TO_NUL: overwrite newlines with ASCII NULs */ #define NEWLINE_TO_NUL(s, l) translit_text(s, l, '\n', '\0') -#ifndef strerror +#ifdef sun # define strerror(n) sys_errlist[n] #endif diff --git a/bin/ed/glob.c b/bin/ed/glbl.c index 5c77d224cdff..1e21d99d2876 100644 --- a/bin/ed/glob.c +++ b/bin/ed/glbl.c @@ -27,7 +27,7 @@ */ #ifndef lint -static char *rcsid = "@(#)$Id: glob.c,v 1.1 1994/02/01 00:34:40 alm Exp $"; +static char *rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp"; #endif /* not lint */ #include <sys/ioctl.h> diff --git a/bin/ed/io.c b/bin/ed/io.c index 0c63f3dc77fb..2187cb999415 100644 --- a/bin/ed/io.c +++ b/bin/ed/io.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char *rcsid = "@(#)$Id: io.c,v 1.1 1994/02/01 00:34:41 alm Exp $"; +static char *rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp"; #endif /* not lint */ #include "ed.h" diff --git a/bin/ed/main.c b/bin/ed/main.c index ddaf513f4337..f177b86ecd9d 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -33,7 +33,7 @@ char *copyright = #endif /* not lint */ #ifndef lint -static char *rcsid = "@(#)$Id: main.c,v 1.1 1994/02/01 00:34:42 alm Exp $"; +static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp"; #endif /* not lint */ /* diff --git a/bin/ed/re.c b/bin/ed/re.c index f4b9f292944b..0e04dd83dd9f 100644 --- a/bin/ed/re.c +++ b/bin/ed/re.c @@ -27,7 +27,7 @@ */ #ifndef lint -static char *rcsid = "@(#)$Id: re.c,v 1.6 1994/02/01 00:34:43 alm Exp $"; +static char *rcsid = "@(#)re.c,v 1.6 1994/02/01 00:34:43 alm Exp"; #endif /* not lint */ #include "ed.h" diff --git a/bin/ed/sub.c b/bin/ed/sub.c index c93d258c8cd2..9d46a7ca3d2e 100644 --- a/bin/ed/sub.c +++ b/bin/ed/sub.c @@ -27,7 +27,7 @@ */ #ifndef lint -static char *rcsid = "@(#)$Id: sub.c,v 1.1 1994/02/01 00:34:44 alm Exp $"; +static char *rcsid = "@(#)sub.c,v 1.1 1994/02/01 00:34:44 alm Exp"; #endif /* not lint */ #include "ed.h" diff --git a/bin/ed/undo.c b/bin/ed/undo.c index a12e1c48e753..a686d14c1b36 100644 --- a/bin/ed/undo.c +++ b/bin/ed/undo.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char *rcsid = "@(#)$Id: undo.c,v 1.1 1994/02/01 00:34:44 alm Exp $"; +static char *rcsid = "@(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp"; #endif /* not lint */ #include "ed.h" diff --git a/bin/expr/expr.1 b/bin/expr/expr.1 index 3cfa19b8f589..e6af35a40b17 100644 --- a/bin/expr/expr.1 +++ b/bin/expr/expr.1 @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: expr.1,v 1.2.2.1 1994/05/01 15:59:55 jkh Exp $ +.\" $Id: expr.1,v 1.3 1994/04/24 01:18:46 jkh Exp $ .\" .Dd July 3, 1993 .Dt EXPR 1 diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 1363d00f80ae..cfcd293a6474 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -34,7 +34,7 @@ .\" .\" @(#)ls.1 6.18 (Berkeley) 6/27/91 .\" -.\" $Header: /home/cvs/386BSD/src/bin/ls/ls.1,v 1.2.2.1 1994/05/01 16:00:04 jkh Exp $ +.\" $Header: /home/cvs/386BSD/src/bin/ls/ls.1,v 1.3 1994/04/24 01:18:52 jkh Exp $ .\" .Dd June 27, 1991 .Dt LS 1 diff --git a/bin/mkdir/mkdir.1 b/bin/mkdir/mkdir.1 index d8d598e4b4d2..85d2387fddcc 100644 --- a/bin/mkdir/mkdir.1 +++ b/bin/mkdir/mkdir.1 @@ -34,7 +34,7 @@ .\" .\" @(#)mkdir.1 6.9 (Berkeley) 6/27/91 .\" -.\" $Header: /home/cvs/386BSD/src/bin/mkdir/mkdir.1,v 1.2.2.1 1994/05/01 16:00:13 jkh Exp $ +.\" $Header: /home/cvs/386BSD/src/bin/mkdir/mkdir.1,v 1.2 1993/07/21 22:54:08 conklin Exp $ .\" .Dd June 27, 1991 .Dt MKDIR 1 diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index b4ec95857c9e..4f59865a8e94 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint static char sccsid[] = "@(#)mkdir.c 5.7 (Berkeley) 5/31/90"; -static char rcsid[] = "$Header: /home/cvs/386BSD/src/bin/mkdir/mkdir.c,v 1.2 1993/07/21 22:54:09 conklin Exp $"; +static char rcsid[] = "$Header: /home/cvs/386BSD/src/bin/mkdir/mkdir.c,v 1.3 1994/05/23 01:15:19 ache Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -118,7 +118,7 @@ build(path, mode, dir_mode) int ch; for (p = path;; ++p) { - if (!*p || *p == '/') { + if (!*p || *p == '/' && p != path) { ch = *p; *p = '\0'; if (stat(path, &sb)) { diff --git a/bin/mv/mv.c b/bin/mv/mv.c index aa37d0229f72..8fa66bb78f17 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -42,7 +42,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)mv.c 5.11 (Berkeley) 4/3/91";*/ -static char rcsid[] = "$Id: mv.c,v 1.2 1993/11/22 23:54:24 jtc Exp $"; +static char rcsid[] = "$Id: mv.c,v 1.3 1994/04/16 00:51:13 davidg Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -229,7 +229,7 @@ fastcopy(from, to, sbp) (void)close(from_fd); return(1); } - if (!blen && !(bp = malloc(blen = sbp->st_blksize))) { + if (!blen && !(bp = malloc(blen = sbp->st_blksize * 4))) { error(NULL); return(1); } diff --git a/bin/rcp/Makefile b/bin/rcp/Makefile index e8cac815eb55..aea1fdd7ba92 100644 --- a/bin/rcp/Makefile +++ b/bin/rcp/Makefile @@ -1,15 +1,15 @@ # @(#)Makefile 5.4 (Berkeley) 10/21/90 PROG= rcp -SRCS= rcp.c +SRCS= rcp.c krcmd.c kcmd.c BINOWN= root BINMODE=4555 .PATH: ${.CURDIR}/../../usr.bin/rlogin -.if exists(/usr/lib/libcrypt.a) -#CFLAGS+=-DCRYPT -DKERBEROS -#DPADD+= ${LIBCRYPT} ${LIBKRB} -#LDADD+= -lcrypt -lkrb +.if exists(${DESTDIR}/usr/lib/libkrb.a) +CFLAGS+=-DCRYPT -DKERBEROS +DPADD+= ${LIBKRB} ${LIBDES} +LDADD+= -lkrb -ldes .endif .include <bsd.prog.mk> diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 45d74488b7fd..d0cf0d2b7bfd 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)rm.c 4.26 (Berkeley) 3/10/91";*/ -static char rcsid[] = "$Id: rm.c,v 1.6.2.1 1994/03/07 02:25:28 rgrimes Exp $"; +static char rcsid[] = "$Id: rm.c,v 1.7 1994/03/05 16:12:06 ats Exp $"; #endif /* not lint */ #include <stdio.h> diff --git a/bin/rmail/rmail.c b/bin/rmail/rmail.c index 40e16887d7c9..7672cbfc44c1 100644 --- a/bin/rmail/rmail.c +++ b/bin/rmail/rmail.c @@ -163,7 +163,6 @@ main(argc, argv) i = 0; args[i++] = _PATH_SENDMAIL; args[i++] = "-oee"; /* no errors, just status */ - args[i++] = "-odq"; /* queue it, don't try to deliver */ args[i++] = "-oi"; /* ignore '.' on a line by itself */ if (fsys[0] != '\0') { /* set sender's host name */ static char junk2[512]; diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index b67393827094..b39e4e45e82d 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)rmdir.c 5.3 (Berkeley) 5/31/90";*/ -static char rcsid[] = "$Id: rmdir.c,v 1.3 1993/11/23 00:13:55 jtc Exp $"; +static char rcsid[] = "$Id: rmdir.c,v 1.4 1994/05/23 01:41:06 ache Exp $"; #endif /* not lint */ /* @@ -117,6 +117,8 @@ rmdirp (path) /* skip trailing slash characters */ while (slash > path && *slash == '/') slash--; + if (*slash == '/') /* don't attempt to remove root */ + return 0; *++slash = '\0'; if (rmdir (path)) { diff --git a/bin/sh/builtins b/bin/sh/builtins index b605bd890533..a08020a82430 100644 --- a/bin/sh/builtins +++ b/bin/sh/builtins @@ -50,7 +50,7 @@ # This file is part of ash, which is distributed under the terms specified # by the Ash General Public License. See the file named LICENSE. -bltincmd command +bltincmd bltin #alloccmd alloc bgcmd -j bg breakcmd break continue diff --git a/bin/sh/cd.c b/bin/sh/cd.c index e458c1f0ae20..615ac7a38fd2 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -217,7 +217,7 @@ top: STPUTC('\0', p); p = grabstackstr(p); INTOFF; - if (chdir(p) < 0) { + if (chdir(*p ? p : ".") < 0) { INTON; return -1; } diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 95d2e504cd70..c350eae3ee7f 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -403,7 +403,7 @@ again: /* jump here after setting a variable with ${var=text} */ if ((c = *p++) == CTLESC) p++; else if (c == CTLBACKQ || c == (CTLBACKQ|CTLQUOTE)) { - if (set) + if (set && argbackq) argbackq = argbackq->next; } else if (c == CTLVAR) { if ((*p++ & VSTYPE) != VSNORMAL) @@ -664,10 +664,10 @@ expandmeta(str) savelastp = exparg.lastp; INTOFF; if (expdir == NULL) - expdir = ckmalloc(8192); /* I hope this is big enough */ + expdir = ckmalloc(16384); /* I hope this is big enough */ expmeta(expdir, str->text); - if(strlen(expdir) >= 8192) - error("malloc overflow in sh:expand.c in ckmalloc(8192)\n"); + if(strlen(expdir) >= 16384) + error("malloc overflow in sh:expand.c in ckmalloc(16384)\n"); ckfree(expdir); expdir = NULL; INTON; diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index b14da674a166..3384cd5c8341 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -89,8 +89,8 @@ readcmd(argc, argv) char **argv; { out2str(prompt); flushall(); } - if ((ap = argptr) == NULL) - error("arg count"); + if (*(ap = argptr) == NULL) + error("bad argument/arg count"); if ((ifs = bltinlookup("IFS", 1)) == NULL) ifs = nullstr; status = 0; diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c index b8e6206cfa59..c105f96c2081 100644 --- a/bin/stty/cchar.c +++ b/bin/stty/cchar.c @@ -60,12 +60,14 @@ struct cchar cchars1[] = { "intr", VINTR, CINTR, "kill", VKILL, CKILL, "lnext", VLNEXT, CLNEXT, + "min", VMIN, CMIN, "quit", VQUIT, CQUIT, "reprint", VREPRINT, CREPRINT, "start", VSTART, CSTART, "status", VSTATUS, CSTATUS, "stop", VSTOP, CSTOP, "susp", VSUSP, CSUSP, + "time", VTIME, CTIME, "werase", VWERASE, CWERASE, NULL, }; @@ -95,8 +97,8 @@ csearch(argvp, ip) tmp.name = name; if (!(cp = (struct cchar *)bsearch(&tmp, cchars1, sizeof(cchars1)/sizeof(struct cchar) - 1, sizeof(struct cchar), - c_cchar)) && !(cp = (struct cchar *)bsearch(&tmp, cchars1, - sizeof(cchars1)/sizeof(struct cchar) - 1, sizeof(struct cchar), + c_cchar)) && !(cp = (struct cchar *)bsearch(&tmp, cchars2, + sizeof(cchars2)/sizeof(struct cchar) - 1, sizeof(struct cchar), c_cchar))) return(0); @@ -109,10 +111,6 @@ csearch(argvp, ip) ip->t.c_cc[cp->sub] = _POSIX_VDISABLE; else if (cp->sub == VMIN || cp->sub == VTIME) { val = strtol(arg, &ep, 10); - if (val == _POSIX_VDISABLE) { - warnx("value of %ld would disable the option -- %s", - val, name); - } if (val > UCHAR_MAX) { warnx("maximum option value is %d -- %s", UCHAR_MAX, name); diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c index d909131ee32c..97021bb31ba3 100644 --- a/bin/stty/gfmt.c +++ b/bin/stty/gfmt.c @@ -163,12 +163,12 @@ gread(tp, s) tp->c_cc[VSUSP] = tmp; continue; } - if (CHK("vmin")) { + if (CHK("min")) { (void)sscanf(ep, "%ld", &tmp); tp->c_cc[VMIN] = tmp; continue; } - if (CHK("vtime")) { + if (CHK("time")) { (void)sscanf(ep, "%ld", &tmp); tp->c_cc[VTIME] = tmp; continue; diff --git a/bin/stty/key.c b/bin/stty/key.c index 6a7aeca935e2..1f7114864058 100644 --- a/bin/stty/key.c +++ b/bin/stty/key.c @@ -276,6 +276,6 @@ f_tty(ip) int tmp; tmp = TTYDISC; - if (ioctl(0, TIOCSETD, &tmp) < 0) + if (ioctl(ip->fd, TIOCSETD, &tmp) < 0) err("TIOCSETD: %s", strerror(errno)); } diff --git a/bin/stty/print.c b/bin/stty/print.c index a3ef040efbec..fdd2f72c406d 100644 --- a/bin/stty/print.c +++ b/bin/stty/print.c @@ -74,6 +74,9 @@ print(tp, wp, ldisc, fmt) case NTTYDISC: cnt += printf("new tty disc; "); break; + case PPPDISC: + cnt += printf("ppp disc; "); + break; default: cnt += printf("#%d disc; ", ldisc); break; @@ -250,13 +253,14 @@ ccval(p, c) static char buf[5]; char *bp; - if (c == _POSIX_VDISABLE) - return("<undef>"); - if (p->sub == VMIN || p->sub == VTIME) { (void)snprintf(buf, sizeof(buf), "%d", c); return (buf); } + + if (c == _POSIX_VDISABLE) + return("<undef>"); + bp = buf; if (c & 0200) { *bp++ = 'M'; |
