Index: bin/sh/input.c =================================================================== --- bin/sh/input.c +++ bin/sh/input.c @@ -38,7 +38,6 @@ #include __FBSDID("$FreeBSD$"); -#include /* defines BUFSIZ */ #include #include #include @@ -62,6 +61,8 @@ #include "myhistedit.h" #include "trap.h" +#define INBUFSIZ (128 * 1024) + #define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */ struct strpush { @@ -94,7 +95,7 @@ int parsenleft; /* copy of parsefile->nleft */ static int parselleft; /* copy of parsefile->lleft */ const char *parsenextc; /* copy of parsefile->nextc */ -static char basebuf[BUFSIZ + 1];/* buffer for top level input file */ +static char basebuf[INBUFSIZ + 1];/* buffer for top level input file */ static struct parsefile basepf = { /* top level input file */ .nextc = basebuf, .buf = basebuf @@ -149,8 +150,8 @@ nr = el_len == 0 ? 0 : -1; else { nr = el_len; - if (nr > BUFSIZ) - nr = BUFSIZ; + if (nr > INBUFSIZ) + nr = INBUFSIZ; memcpy(parsefile->buf, rl_cp, nr); if (nr != el_len) { el_len -= nr; @@ -160,7 +161,7 @@ } } else #endif - nr = read(parsefile->fd, parsefile->buf, BUFSIZ); + nr = read(parsefile->fd, parsefile->buf, INBUFSIZ); if (nr <= 0) { if (nr < 0) { @@ -387,13 +388,13 @@ { if (push) { pushfile(); - parsefile->buf = ckmalloc(BUFSIZ + 1); + parsefile->buf = ckmalloc(INBUFSIZ + 1); } if (parsefile->fd > 0) close(parsefile->fd); parsefile->fd = fd; if (parsefile->buf == NULL) - parsefile->buf = ckmalloc(BUFSIZ + 1); + parsefile->buf = ckmalloc(INBUFSIZ + 1); parselleft = parsenleft = 0; plinno = 1; }