bb_get_[chomped]line_from_file wasn't descriptive enough.

Renaming...
This commit is contained in:
Denis Vlasenko
2006-10-12 22:43:20 +00:00
parent 372686bde7
commit 2d5ca60bfb
20 changed files with 33 additions and 32 deletions

View File

@ -50,7 +50,7 @@ static void cut_file(FILE * file)
unsigned int linenum = 0; /* keep these zero-based to be consistent */
/* go through every line in the file */
while ((line = bb_get_chomped_line_from_file(file)) != NULL) {
while ((line = xmalloc_getline(file)) != NULL) {
/* set up a list so we can keep track of what's been printed */
char * printed = xzalloc(strlen(line) * sizeof(char));

View File

@ -126,7 +126,7 @@ int md5_sha1_sum_main(int argc, char **argv)
pre_computed_stream = xfopen(file_ptr, "r");
}
while ((line = bb_get_chomped_line_from_file(pre_computed_stream)) != NULL) {
while ((line = xmalloc_getline(pre_computed_stream)) != NULL) {
char *filename_ptr;
count_total++;

View File

@ -124,9 +124,9 @@ static struct sort_key *add_key(void)
}
#define GET_LINE(fp) (global_flags&FLAG_z) ? bb_get_chunk_from_file(fp,NULL) \
: bb_get_chomped_line_from_file(fp)
: xmalloc_getline(fp)
#else
#define GET_LINE(fp) bb_get_chomped_line_from_file(fp)
#define GET_LINE(fp) xmalloc_getline(fp)
#endif
/* Iterate through keys list and perform comparisons */

View File

@ -69,7 +69,7 @@ int uniq_main(int argc, char **argv)
dups = 0;
/* gnu uniq ignores newlines */
while ((s1 = bb_get_chomped_line_from_file(in)) != NULL) {
while ((s1 = xmalloc_getline(in)) != NULL) {
e1 = s1;
for (i=skip_fields ; i ; i--) {
e1 = skip_whitespace(e1);

View File

@ -18,7 +18,7 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
{
char *line;
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
while ((line = xmalloc_getline(src_stream)) != NULL) {
int length;
char *line_ptr = line;
@ -140,7 +140,7 @@ int uudecode_main(int argc, char **argv)
}
/* Search for the start of the encoding */
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
while ((line = xmalloc_getline(src_stream)) != NULL) {
int (*decode_fn_ptr)(FILE * src, FILE * dst);
char *line_ptr;
FILE *dst_stream;