1
0
mirror of https://github.com/git/git.git synced 2024-09-28 08:49:45 +02:00

vcs-svn: eliminate global byte_buffer

The data stored in byte_buffer[] is always either discarded or
written to stdout immediately.  No need for it to persist between
function calls.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
This commit is contained in:
Jonathan Nieder 2010-10-10 21:37:10 -05:00
parent 8dc6a373d2
commit 4d21bec0d2

View File

@ -14,7 +14,6 @@
obj_pool_gen(blob, char, 4096)
static char line_buffer[LINE_BUFFER_LEN];
static char byte_buffer[COPY_BUFFER_LEN];
static FILE *infile;
int buffer_init(const char *filename)
@ -68,6 +67,7 @@ char *buffer_read_string(uint32_t len)
void buffer_copy_bytes(uint32_t len)
{
char byte_buffer[COPY_BUFFER_LEN];
uint32_t in;
while (len > 0 && !feof(infile) && !ferror(infile)) {
in = len < COPY_BUFFER_LEN ? len : COPY_BUFFER_LEN;
@ -83,6 +83,7 @@ void buffer_copy_bytes(uint32_t len)
void buffer_skip_bytes(uint32_t len)
{
char byte_buffer[COPY_BUFFER_LEN];
uint32_t in;
while (len > 0 && !feof(infile) && !ferror(infile)) {
in = len < COPY_BUFFER_LEN ? len : COPY_BUFFER_LEN;