diff options
Diffstat (limited to 'usr.bin/vi')
-rw-r--r-- | usr.bin/vi/LICENSE | 10 | ||||
-rw-r--r-- | usr.bin/vi/common/msg.c | 37 | ||||
-rw-r--r-- | usr.bin/vi/docs/USD.doc/vi.man/vi.1 | 14 | ||||
-rw-r--r-- | usr.bin/vi/docs/USD.doc/vi.ref/vi.ref | 12 | ||||
-rw-r--r-- | usr.bin/vi/docs/changelog | 8 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_shell.c | 6 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_subst.c | 8 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_version.c | 4 | ||||
-rw-r--r-- | usr.bin/vi/ex/version.h | 2 | ||||
-rw-r--r-- | usr.bin/vi/vi/vs_split.c | 23 |
10 files changed, 75 insertions, 49 deletions
diff --git a/usr.bin/vi/LICENSE b/usr.bin/vi/LICENSE index 0ef3f3e3954..1c54e6f4daa 100644 --- a/usr.bin/vi/LICENSE +++ b/usr.bin/vi/LICENSE @@ -46,9 +46,9 @@ * 3. For permission to redistribute this program under conditions other * than these, contact Keith Bostic. * - * The vi program is shareware. You are welcome to copy, modify and share - * it with others under the conditions listed in the LICENSE file. If your - * company finds vi sufficiently useful that you would have purchased it, - * or your company wishes to redistribute it, contributions to the authors - * would be appreciated. + * The vi program is freely redistributable. You are welcome to copy, + * modify and share it with others under the conditions listed in the + * LICENSE file. If any company (not individual!) finds vi sufficiently + * useful that you would have purchased it, or if any company wishes to + * redistribute it, contributions to the authors would be appreciated. */ diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c index c56fad36989..f973f7231cc 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.45 (Berkeley) 8/18/96"; +static const char sccsid[] = "@(#)msg.c 10.46 (Berkeley) 8/19/96"; #endif /* not lint */ #include <sys/param.h> @@ -146,7 +146,7 @@ retry: FREE_SPACE(sp, bp, blen); p = msg_cat(sp, "020|Error: ", &len); if (REM < len) goto retry; - memmove(mp, p, len); + memcpy(mp, p, len); mp += len; mlen += len; } @@ -525,12 +525,15 @@ msgq_status(sp, lno, flags) /* Get sufficient memory. */ len = strlen(sp->frp->name); - GET_SPACE_GOTO(sp, bp, blen, len + 128); + GET_SPACE_GOTO(sp, bp, blen, len * MAX_CHARACTER_COLUMNS + 128); p = bp; /* Copy in the filename. */ - memmove(p, sp->frp->name, len); - p += len; + for (p = bp, t = sp->frp->name; *t != '\0'; ++t) { + len = KEY_LEN(sp, *t); + memcpy(p, KEY_NAME(sp, *t), len); + p += len; + } np = p; *p++ = ':'; *p++ = ' '; @@ -559,13 +562,13 @@ msgq_status(sp, lno, flags) if (F_ISSET(sp->frp, FR_NEWFILE)) { F_CLR(sp->frp, FR_NEWFILE); t = msg_cat(sp, "021|new file", &len); - memmove(p, t, len); + memcpy(p, t, len); p += len; needsep = 1; } else { if (F_ISSET(sp->frp, FR_NAMECHANGE)) { t = msg_cat(sp, "022|name changed", &len); - memmove(p, t, len); + memcpy(p, t, len); p += len; needsep = 1; } @@ -577,7 +580,7 @@ msgq_status(sp, lno, flags) t = msg_cat(sp, "023|modified", &len); else t = msg_cat(sp, "024|unmodified", &len); - memmove(p, t, len); + memcpy(p, t, len); p += len; needsep = 1; } @@ -587,7 +590,7 @@ msgq_status(sp, lno, flags) *p++ = ' '; } t = msg_cat(sp, "025|UNLOCKED", &len); - memmove(p, t, len); + memcpy(p, t, len); p += len; needsep = 1; } @@ -597,7 +600,7 @@ msgq_status(sp, lno, flags) *p++ = ' '; } t = msg_cat(sp, "026|readonly", &len); - memmove(p, t, len); + memcpy(p, t, len); p += len; needsep = 1; } @@ -610,7 +613,7 @@ msgq_status(sp, lno, flags) return; if (last == 0) { t = msg_cat(sp, "028|empty file", &len); - memmove(p, t, len); + memcpy(p, t, len); p += len; } else { t = msg_cat(sp, "027|line %lu of %lu [%ld%%]", &len); @@ -635,11 +638,13 @@ msgq_status(sp, lno, flags) * permission of Keith Bostic. See the LICENSE file for further * information. */ -#define POISON " (UNLICENSED)" - if (!poisoned && len + 1 + (sizeof(POISON) - 1) < sp->cols) { +#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 += sizeof(POISON) - 1; - len += sizeof(POISON) - 1; + p = (bp + sp->cols) - 1; + len = p - bp; poisoned = 1; } @@ -662,7 +667,7 @@ msgq_status(sp, lno, flags) * characters for those screens. Make it really hard to screw this up. */ s = bp; - if (LF_ISSET(MSTAT_TRUNCATE) && len >= sp->cols) { + if (LF_ISSET(MSTAT_TRUNCATE) && len > sp->cols) { for (; s < np && (*s != '/' || (p - s) > sp->cols - 3); ++s); if (s == np) { s = p - (sp->cols - 5); diff --git a/usr.bin/vi/docs/USD.doc/vi.man/vi.1 b/usr.bin/vi/docs/USD.doc/vi.man/vi.1 index d17ff50db56..9c9187dde71 100644 --- a/usr.bin/vi/docs/USD.doc/vi.man/vi.1 +++ b/usr.bin/vi/docs/USD.doc/vi.man/vi.1 @@ -8,9 +8,9 @@ .\" .\" See the LICENSE file for redistribution information. .\" -.\" @(#)vi.1 8.48 (Berkeley) 8/18/96 +.\" @(#)vi.1 8.49 (Berkeley) 8/20/96 .\" -.TH VI 1 "August 18, 1996" +.TH VI 1 "August 20, 1996" .UC .SH NAME ex, vi, view \- text editors @@ -48,11 +48,11 @@ ex, vi, view \- text editors .BI -w " size"\c ] [file ...] .SH LICENSE -The vi program is shareware. You are welcome to copy, modify and share -it with others under the conditions listed in the LICENSE file. If your -company finds vi sufficiently useful that you would have purchased it, -or your company wishes to redistribute it, contributions to the authors -would be appreciated. +The vi program is freely redistributable. You are welcome to copy, +modify and share it with others under the conditions listed in the +LICENSE file. If any company (not individual!) finds vi sufficiently +useful that you would have purchased it, or if any company wishes to +redistribute it, contributions to the authors would be appreciated. .SH DESCRIPTION .I \&Vi is a screen oriented text editor. diff --git a/usr.bin/vi/docs/USD.doc/vi.ref/vi.ref b/usr.bin/vi/docs/USD.doc/vi.ref/vi.ref index c5d3ec9f387..338099a427e 100644 --- a/usr.bin/vi/docs/USD.doc/vi.ref/vi.ref +++ b/usr.bin/vi/docs/USD.doc/vi.ref/vi.ref @@ -8,7 +8,7 @@ .\" .\" See the LICENSE file for redistribution information. .\" -.\" @(#)vi.ref 8.82 (Berkeley) 8/18/96 +.\" @(#)vi.ref 8.83 (Berkeley) 8/20/96 .\" .\" .so ref.so @@ -57,11 +57,11 @@ Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996 Keith Bostic. All Rights Reserved. .sp .pp -The vi program is shareware. You are welcome to copy, modify and share -it with others under the conditions listed in the LICENSE file. If your -company finds vi sufficiently useful that you would have purchased it, -or your company wishes to redistribute it, contributions to the authors -would be appreciated. +The vi program is freely redistributable. You are welcome to copy, +modify and share it with others under the conditions listed in the +LICENSE file. If any company (not individual!) finds vi sufficiently +useful that you would have purchased it, or if any company wishes to +redistribute it, contributions to the authors would be appreciated. .bp 2 .(l C .i Acknowledgements diff --git a/usr.bin/vi/docs/changelog b/usr.bin/vi/docs/changelog index dc3a7cc0c27..b864a202108 100644 --- a/usr.bin/vi/docs/changelog +++ b/usr.bin/vi/docs/changelog @@ -1,3 +1,11 @@ +1.74 -> 1.75 (08/22/96) + + Add French to the error message translations. + + Move the UNLICENSED message to the end of the message line. + + Fix bug where wide characters in a file name weren't calculated + correctly in the status message. + + Fix bug where cl_rename was called directly, by the ex shell code. + + Fix bug where splitting a screen resulting in a new screen at the + top of the display resulted in badly displayed status messages. 1.73 -> 1.74 (08/18/96) + Fix bug where the status line wasn't redisplayed if the user ran an ex command that trashed the screen. diff --git a/usr.bin/vi/ex/ex_shell.c b/usr.bin/vi/ex/ex_shell.c index 5848baee0b3..95168033a13 100644 --- a/usr.bin/vi/ex/ex_shell.c +++ b/usr.bin/vi/ex/ex_shell.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)ex_shell.c 10.37 (Berkeley) 8/11/96"; +static const char sccsid[] = "@(#)ex_shell.c 10.38 (Berkeley) 8/19/96"; #endif /* not lint */ #include <sys/param.h> @@ -56,13 +56,13 @@ ex_shell(sp, cmdp) (void)snprintf(buf, sizeof(buf), "%s -i", O_STR(sp, O_SHELL)); /* Restore the window name. */ - (void)cl_rename(sp, NULL, 0); + (void)sp->gp->scr_rename(sp, NULL, 0); /* If we're still in a vi screen, move out explicitly. */ rval = ex_exec_proc(sp, cmdp, buf, NULL, !F_ISSET(sp, SC_SCR_EXWROTE)); /* Set the window name. */ - (void)cl_rename(sp, sp->frp->name, 1); + (void)sp->gp->scr_rename(sp, sp->frp->name, 1); /* * !!! diff --git a/usr.bin/vi/ex/ex_subst.c b/usr.bin/vi/ex/ex_subst.c index 52fef271698..16fd3345dc3 100644 --- a/usr.bin/vi/ex/ex_subst.c +++ b/usr.bin/vi/ex/ex_subst.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)ex_subst.c 10.35 (Berkeley) 8/11/96"; +static const char sccsid[] = "@(#)ex_subst.c 10.36 (Berkeley) 8/20/96"; #endif /* not lint */ #include <sys/types.h> @@ -1219,10 +1219,10 @@ re_tag_conv(sp, ptrnp, plenp, replacedp) * characters. */ for (; len > 0; --len) { - /* Ctags escapes the search delimiter characters. */ - if (p[0] == '\\' && (p[1] == '/' || p[1] == '?')) + if (p[0] == '\\' && (p[1] == '/' || p[1] == '?')) { ++p; - else if (strchr("^.[]$*", p[0])) + --len; + } else if (strchr("^.[]$*", p[0])) *t++ = '\\'; *t++ = *p++; } diff --git a/usr.bin/vi/ex/ex_version.c b/usr.bin/vi/ex/ex_version.c index 030b020f6ce..d7363c8bd1a 100644 --- a/usr.bin/vi/ex/ex_version.c +++ b/usr.bin/vi/ex/ex_version.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)ex_version.c 10.30 (Berkeley) 8/17/96"; +static const char sccsid[] = "@(#)ex_version.c 10.31 (Berkeley) 8/22/96"; #endif /* not lint */ #include <sys/types.h> @@ -34,8 +34,6 @@ ex_version(sp, cmdp) SCR *sp; EXCMD *cmdp; { - msgq(sp, M_INFO, - "Vi is shareware: see the LICENSE file for details."); msgq(sp, M_INFO, VI_VERSION); return (0); } diff --git a/usr.bin/vi/ex/version.h b/usr.bin/vi/ex/version.h index c0a2f3c18f1..dc8109190f5 100644 --- a/usr.bin/vi/ex/version.h +++ b/usr.bin/vi/ex/version.h @@ -1,2 +1,2 @@ #define VI_VERSION \ - "Version 1.74 (8/18/96) The CSRG, University of California, Berkeley." + "Version 1.75 (8/22/96) The CSRG, University of California, Berkeley." diff --git a/usr.bin/vi/vi/vs_split.c b/usr.bin/vi/vi/vs_split.c index 3257ead9d66..30e60e8222b 100644 --- a/usr.bin/vi/vi/vs_split.c +++ b/usr.bin/vi/vi/vs_split.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)vs_split.c 10.28 (Berkeley) 6/30/96"; +static const char sccsid[] = "@(#)vs_split.c 10.29 (Berkeley) 8/19/96"; #endif /* not lint */ #include <sys/types.h> @@ -166,9 +166,24 @@ vs_split(sp, new, ccl) if ((new->defscroll = new->t_maxrows / 2) == 0) new->defscroll = 1; - /* Draw the new screen from scratch, and add a status line. */ - F_SET(new, SC_SCR_REFORMAT | SC_STATUS); - + /* + * Initialize the screen flags: + * + * If we're in vi mode in one screen, we don't have to reinitialize. + * This isn't just a cosmetic fix. The path goes like this: + * + * return into vi(), SC_SSWITCH set + * call vs_refresh() with SC_STATUS set + * call vs_resolve to display the status message + * call vs_refresh() because the SC_SCR_VI bit isn't set + * + * Things go downhill at this point. + * + * Draw the new screen from scratch, and add a status line. + */ + F_SET(new, + SC_SCR_REFORMAT | SC_STATUS | + F_ISSET(sp, SC_EX | SC_VI | SC_SCR_VI | SC_SCR_EX)); return (0); } |