ex (not vi) can now edit files with lines of arbitrary length.

This commit is contained in:
Gunnar Ritter
2005-08-04 15:23:39 +00:00
parent 2b70d8e5eb
commit b0ff1d6b3e
26 changed files with 183 additions and 105 deletions

13
ex.c
View File

@@ -77,7 +77,7 @@ char *copyright =
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
All rights reserved.\n";
static char sccsid[] = "@(#)ex.c 1.36 (gritter) 2/13/05";
static char sccsid[] = "@(#)ex.c 1.37 (gritter) 8/4/05";
#endif /* DOSCCS */
#endif /* !lint */
@@ -294,6 +294,13 @@ main(register int ac, register char *av[])
poolsbrk(0);
#endif
/*
* Initialize the primary buffers which were originally static.
* NOTE: Most of this must be repeated in ex_recover.c.
*/
linebuf = calloc(LBSIZE = BUFSIZ<4096?4096:BUFSIZ, sizeof *linebuf);
genbuf = calloc(MAXBSIZE, sizeof *genbuf);
/*
* Immediately grab the tty modes so that we wont
* get messed up if an interrupt comes in quickly.
@@ -588,9 +595,9 @@ argend:
else {
globp = 0;
if ((cp = getenv("HOME")) != 0 && *cp) {
safecat(safecp(genbuf, cp, sizeof genbuf,
safecat(safecp(genbuf, cp, MAXBSIZE,
"$HOME too long"),
"/.exrc", sizeof genbuf,
"/.exrc", MAXBSIZE,
"$HOME too long");
if (iownit(genbuf))
source(genbuf, 1);