aboutsummaryrefslogtreecommitdiff
path: root/libbb/read_text_file_to_buffer.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-06-13 07:34:03 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-06-13 07:34:03 +0000
commit17822cd60aaf9333a9895494edcf03a0037de54c (patch)
tree3bf667fdf5b78df26acfc662955d7e38f3c5c4d5 /libbb/read_text_file_to_buffer.c
parent9aff9036035fbed074e8e711b96c5c934e668884 (diff)
downloadbusybox-17822cd60aaf9333a9895494edcf03a0037de54c.tar.gz
Reorganise unarchive functions, new files, removed some
Diffstat (limited to 'libbb/read_text_file_to_buffer.c')
-rw-r--r--libbb/read_text_file_to_buffer.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/libbb/read_text_file_to_buffer.c b/libbb/read_text_file_to_buffer.c
deleted file mode 100644
index ef64ad712..000000000
--- a/libbb/read_text_file_to_buffer.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "libbb.h"
-
-/*
- * Reads consecutive lines from file line that start with end_string
- * read finishes at an empty line or eof
- */
-extern char *read_text_file_to_buffer(FILE *src_file)
-{
- char *line = NULL;
- char *buffer = NULL;
- int buffer_length = 0;
- int line_length = 0;
-
- buffer = xmalloc(1);
- strcpy(buffer, "");
-
- /* Loop until line is empty, or just one char, which will be '\n' */
- do {
- line = get_line_from_file(src_file);
- if (line == NULL) {
- break;
- }
- line_length = strlen(line);
- buffer_length += line_length + 1;
- buffer = (char *) xrealloc(buffer, buffer_length + 1);
- strcat(buffer, line);
- free(line);
- } while (line_length > 1);
-
- if (strlen(buffer) == 0) {
- return(NULL);
- } else {
- return(strdup(buffer));
- }
-} \ No newline at end of file