--- coreutils-gentoo-patches.orig/coreutils-progress-bar.patch 2003-08-24 22:15:51.000000000 +0200 +++ coreutils-gentoo-patches.orig/coreutils-progress-bar.patch 2003-08-26 03:46:27.000000000 +0200 @@ -108,7 +108,7 @@ /* Copy a regular file from SRC_PATH to DST_PATH. If the source file contains holes, copies holes and blocks of zeros in the source file as holes in the destination file. -@@ -216,6 +282,16 @@ copy_reg (const char *src_path, const ch +@@ -216,6 +282,19 @@ copy_reg (const char *src_path, const ch off_t n_read_total = 0; int last_write_made_hole = 0; int make_holes = (x->sparse_mode == SPARSE_ALWAYS); @@ -122,6 +122,9 @@ + off_t sample_sum = 0; + int sample_count = 0; + int line_length = 80; ++#ifdef TIOCGWINSZ ++ struct winsize ws; ++#endif source_desc = open (src_path, O_RDONLY); if (source_desc < 0) @@ -135,7 +138,7 @@ for (;;) { ssize_t n_read = read (source_desc, buf, buf_size); -@@ -377,6 +456,115 @@ copy_reg (const char *src_path, const ch +@@ -377,6 +456,113 @@ copy_reg (const char *src_path, const ch } last_write_made_hole = 0; } @@ -170,8 +173,6 @@ + } + +#ifdef TIOCGWINSZ -+ struct winsize ws; -+ + if (ioctl (STDOUT_FILENO, TIOCGWINSZ, &ws) != -1 && ws.ws_col != 0) + { + line_length = ws.ws_col;