Page MenuHomeFreeBSD

D17582.id49275.diff
No OneTemporary

D17582.id49275.diff

Index: bin/sh/input.c
===================================================================
--- bin/sh/input.c
+++ bin/sh/input.c
@@ -38,7 +38,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <stdio.h> /* defines BUFSIZ */
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
@@ -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;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 13, 4:40 AM (1 m, 21 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38815833
Default Alt Text
D17582.id49275.diff (1 KB)

Event Timeline