summaryrefslogtreecommitdiff
path: root/usr.bin/vi/common
diff options
context:
space:
mode:
authormichaels <michaels@cvs.openbsd.org>1996-09-17 17:19:12 +0000
committermichaels <michaels@cvs.openbsd.org>1996-09-17 17:19:12 +0000
commitfed417a38b95b13128c9588fd9f104da9b06bf41 (patch)
tree9591de9a563efff93cad28ba39dc4faf29aa4d92 /usr.bin/vi/common
parent8cb1a1f6c9600981e4080fa44207d08d8c080e8f (diff)
nvi 1.76:
+ Fix bug where ^V didn't keep input mapping from happening. + Fix a core dump bug in the R command. + Give up on licensing: no more shareware, adware, whatever. + Fix cursor positioning bug for C, S and c$ in an empty file.
Diffstat (limited to 'usr.bin/vi/common')
-rw-r--r--usr.bin/vi/common/api.c3
-rw-r--r--usr.bin/vi/common/cut.c6
-rw-r--r--usr.bin/vi/common/delete.c12
-rw-r--r--usr.bin/vi/common/line.c5
-rw-r--r--usr.bin/vi/common/msg.c27
-rw-r--r--usr.bin/vi/common/options.c4
-rw-r--r--usr.bin/vi/common/put.c12
-rw-r--r--usr.bin/vi/common/recover.c3
-rw-r--r--usr.bin/vi/common/screen.c4
-rw-r--r--usr.bin/vi/common/util.c4
10 files changed, 29 insertions, 51 deletions
diff --git a/usr.bin/vi/common/api.c b/usr.bin/vi/common/api.c
index 9314fe6d047..62f61d0256b 100644
--- a/usr.bin/vi/common/api.c
+++ b/usr.bin/vi/common/api.c
@@ -12,7 +12,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)api.c 8.22 (Berkeley) 8/10/96";
+static const char sccsid[] = "@(#)api.c 8.23 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -21,7 +21,6 @@ static const char sccsid[] = "@(#)api.c 8.22 (Berkeley) 8/10/96";
#include <bitstring.h>
#include <limits.h>
-#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/vi/common/cut.c b/usr.bin/vi/common/cut.c
index 320dcfa2bdc..faceecd1116 100644
--- a/usr.bin/vi/common/cut.c
+++ b/usr.bin/vi/common/cut.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)cut.c 10.9 (Berkeley) 3/30/96";
+static const char sccsid[] = "@(#)cut.c 10.10 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -266,7 +266,7 @@ cut_line(sp, lno, fcno, clen, cbp)
if (len != 0) {
if (clen == 0)
clen = len - fcno;
- memmove(tp->lb, p + fcno, clen);
+ memcpy(tp->lb, p + fcno, clen);
tp->len = clen;
}
@@ -328,7 +328,7 @@ text_init(sp, p, len, total_len)
return (NULL);
}
if (p != NULL && len != 0)
- memmove(tp->lb, p, len);
+ memcpy(tp->lb, p, len);
}
tp->len = len;
return (tp);
diff --git a/usr.bin/vi/common/delete.c b/usr.bin/vi/common/delete.c
index e6229c0cc2f..2c60b341a38 100644
--- a/usr.bin/vi/common/delete.c
+++ b/usr.bin/vi/common/delete.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)delete.c 10.10 (Berkeley) 3/6/96";
+static const char sccsid[] = "@(#)delete.c 10.11 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -81,7 +81,7 @@ delete(sp, fm, tm, lmode)
if (db_get(sp, fm->lno, DBG_FATAL, &p, &len))
return (1);
GET_SPACE_RET(sp, bp, blen, fm->cno);
- memmove(bp, p, fm->cno);
+ memcpy(bp, p, fm->cno);
if (db_set(sp, fm->lno, bp, fm->cno))
return (1);
goto done;
@@ -94,8 +94,8 @@ delete(sp, fm, tm, lmode)
return (1);
GET_SPACE_RET(sp, bp, blen, len);
if (fm->cno != 0)
- memmove(bp, p, fm->cno);
- memmove(bp + fm->cno, p + (tm->cno + 1), len - (tm->cno + 1));
+ memcpy(bp, p, fm->cno);
+ memcpy(bp + fm->cno, p + (tm->cno + 1), len - (tm->cno + 1));
if (db_set(sp, fm->lno,
bp, len - ((tm->cno - fm->cno) + 1)))
goto err;
@@ -111,7 +111,7 @@ delete(sp, fm, tm, lmode)
if (db_get(sp, fm->lno, DBG_FATAL, &p, NULL))
return (1);
GET_SPACE_RET(sp, bp, blen, tlen + 256);
- memmove(bp, p, tlen);
+ memcpy(bp, p, tlen);
}
/* Copy the end partial line into place. */
@@ -134,7 +134,7 @@ delete(sp, fm, tm, lmode)
} else
ADD_SPACE_RET(sp, bp, blen, nlen);
- memmove(bp + tlen, p + (tm->cno + 1), len - (tm->cno + 1));
+ memcpy(bp + tlen, p + (tm->cno + 1), len - (tm->cno + 1));
tlen += len - (tm->cno + 1);
}
diff --git a/usr.bin/vi/common/line.c b/usr.bin/vi/common/line.c
index 1639cc79026..bcb9e0c86bc 100644
--- a/usr.bin/vi/common/line.c
+++ b/usr.bin/vi/common/line.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)line.c 10.20 (Berkeley) 4/27/96";
+static const char sccsid[] = "@(#)line.c 10.21 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -20,7 +20,6 @@ static const char sccsid[] = "@(#)line.c 10.20 (Berkeley) 4/27/96";
#include <bitstring.h>
#include <errno.h>
#include <limits.h>
-#include <signal.h>
#include <stdio.h>
#include <string.h>
@@ -521,7 +520,7 @@ db_last(sp, lnop)
}
/* Fill the cache. */
- memmove(&lno, key.data, sizeof(lno));
+ memcpy(&lno, key.data, sizeof(lno));
ep->c_nlines = ep->c_lno = lno;
ep->c_len = data.size;
ep->c_lp = data.data;
diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c
index f973f7231cc..2b18082c7ab 100644
--- a/usr.bin/vi/common/msg.c
+++ b/usr.bin/vi/common/msg.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)msg.c 10.46 (Berkeley) 8/19/96";
+static const char sccsid[] = "@(#)msg.c 10.48 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/param.h>
@@ -477,13 +477,13 @@ mod_rpt(sp)
tlen += len;
t = msg_cat(sp,
lines[sp->rptlines[cnt] == 1 ? 0 : 1], &len);
- memmove(p, t, len);
+ memcpy(p, t, len);
p += len;
tlen += len;
*p++ = ' ';
++tlen;
t = msg_cat(sp, *ap, &len);
- memmove(p, t, len);
+ memcpy(p, t, len);
p += len;
tlen += len;
sp->rptlines[cnt] = 0;
@@ -629,27 +629,8 @@ msgq_status(sp, lno, flags)
(void)sprintf(p, " (pid %lu)", (u_long)getpid());
p += strlen(p);
#endif
- len = p - bp;
-
- /*
- * Poison.
- *
- * This message may not be altered in any way, without the written
- * permission of Keith Bostic. See the LICENSE file for further
- * information.
- */
-#define POISON " UNLICENSED"
- if (!poisoned && len < sp->cols - ((sizeof(POISON) - 1) + 1)) {
- memset(p, ' ', sp->cols - len);
- p = (bp + sp->cols) - ((sizeof(POISON) - 1) + 1);
- memcpy(p, POISON, sizeof(POISON) - 1);
- p = (bp + sp->cols) - 1;
- len = p - bp;
- poisoned = 1;
- }
-
*p++ = '\n';
- ++len;
+ len = p - bp;
/*
* There's a nasty problem with long path names. Cscope and tags files
diff --git a/usr.bin/vi/common/options.c b/usr.bin/vi/common/options.c
index 9dea74ddff3..8b5468e45ff 100644
--- a/usr.bin/vi/common/options.c
+++ b/usr.bin/vi/common/options.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)options.c 10.48 (Berkeley) 8/10/96";
+static const char sccsid[] = "@(#)options.c 10.49 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -1072,7 +1072,7 @@ opts_copy(orig, sp)
int cnt, rval;
/* Copy most everything without change. */
- memmove(sp->opts, orig->opts, sizeof(orig->opts));
+ memcpy(sp->opts, orig->opts, sizeof(orig->opts));
/* Copy the string edit options. */
for (cnt = rval = 0; cnt < O_OPTIONCOUNT; ++cnt) {
diff --git a/usr.bin/vi/common/put.c b/usr.bin/vi/common/put.c
index 76623e479d3..66e40a410ba 100644
--- a/usr.bin/vi/common/put.c
+++ b/usr.bin/vi/common/put.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)put.c 10.9 (Berkeley) 3/6/96";
+static const char sccsid[] = "@(#)put.c 10.10 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -125,13 +125,13 @@ put(sp, cbp, namep, cp, rp, append)
/* Original line, left of the split. */
if (len > 0 && (clen = cp->cno + (append ? 1 : 0)) > 0) {
- memmove(bp, p, clen);
+ memcpy(bp, p, clen);
p += clen;
t += clen;
}
/* First line from the CB. */
- memmove(t, tp->lb, tp->len);
+ memcpy(t, tp->lb, tp->len);
t += tp->len;
/* Calculate length left in the original line. */
@@ -161,7 +161,7 @@ put(sp, cbp, namep, cp, rp, append)
*/
if (tp->q.cqe_next == (void *)&cbp->textq) {
if (clen > 0) {
- memmove(t, p, clen);
+ memcpy(t, p, clen);
t += clen;
}
if (db_set(sp, lno, bp, t - bp))
@@ -187,9 +187,9 @@ put(sp, cbp, namep, cp, rp, append)
t = bp + len;
/* Add in last part of the CB. */
- memmove(t, ltp->lb, ltp->len);
+ memcpy(t, ltp->lb, ltp->len);
if (clen)
- memmove(t + ltp->len, p, clen);
+ memcpy(t + ltp->len, p, clen);
clen += ltp->len;
/*
diff --git a/usr.bin/vi/common/recover.c b/usr.bin/vi/common/recover.c
index 10702cc384f..f3abaab5a53 100644
--- a/usr.bin/vi/common/recover.c
+++ b/usr.bin/vi/common/recover.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)recover.c 10.20 (Berkeley) 6/20/96";
+static const char sccsid[] = "@(#)recover.c 10.21 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/param.h>
@@ -31,7 +31,6 @@ static const char sccsid[] = "@(#)recover.c 10.20 (Berkeley) 6/20/96";
#include <fcntl.h>
#include <limits.h>
#include <pwd.h>
-#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/vi/common/screen.c b/usr.bin/vi/common/screen.c
index dfc4e40473b..ba9e287b648 100644
--- a/usr.bin/vi/common/screen.c
+++ b/usr.bin/vi/common/screen.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)screen.c 10.14 (Berkeley) 7/19/96";
+static const char sccsid[] = "@(#)screen.c 10.15 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -100,7 +100,7 @@ mem: msgq(orig, M_SYSERR, NULL);
}
sp->newl_len = orig->newl_len;
sp->newl_cnt = orig->newl_cnt;
- memmove(sp->newl, orig->newl, len);
+ memcpy(sp->newl, orig->newl, len);
}
if (opts_copy(orig, sp))
diff --git a/usr.bin/vi/common/util.c b/usr.bin/vi/common/util.c
index 1fb95bf898e..5a4422a2c42 100644
--- a/usr.bin/vi/common/util.c
+++ b/usr.bin/vi/common/util.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)util.c 10.10 (Berkeley) 3/6/96";
+static const char sccsid[] = "@(#)util.c 10.11 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -136,7 +136,7 @@ v_strdup(sp, str, len)
MALLOC(sp, copy, CHAR_T *, len + 1);
if (copy == NULL)
return (NULL);
- memmove(copy, str, len * sizeof(CHAR_T));
+ memcpy(copy, str, len * sizeof(CHAR_T));
copy[len] = '\0';
return (copy);
}