mirror of
https://github.com/jarun/advcpmv.git
synced 2026-02-01 13:17:41 +01:00
Fix reducing bar length crashes on smaller screens
The "Copying at..." string can be > reduced length
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
--- coreutils-8.32/src/copy.c 2020-01-01 19:43:12.000000000 +0530
|
||||
+++ coreutils-8.32-patched/src/copy.c 2020-10-26 19:27:59.398765746 +0530
|
||||
+++ coreutils-8.32-patched/src/copy.c 2020-12-06 22:25:53.076852462 +0530
|
||||
@@ -129,6 +129,72 @@
|
||||
dev_t dev;
|
||||
};
|
||||
@@ -222,7 +222,7 @@ diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
goto fail;
|
||||
|
||||
dest_pos = ext_start + n_read;
|
||||
@@ -1305,6 +1467,70 @@
|
||||
@@ -1305,6 +1467,71 @@
|
||||
buf_alloc = xmalloc (buf_size + buf_alignment);
|
||||
buf = ptr_align (buf_alloc, buf_alignment);
|
||||
|
||||
@@ -233,7 +233,8 @@ diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
+ int iBarLength = 80;
|
||||
+ struct winsize win;
|
||||
+ if ( ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &win) == 0 && win.ws_col > 0 )
|
||||
+ iBarLength = win.ws_col;
|
||||
+ if (win.ws_col > iBarLength) /* String printed may be longer on smaller screens */
|
||||
+ iBarLength = win.ws_col;
|
||||
+ /* create rows */
|
||||
+ int it;
|
||||
+ for ( it = 0; it < 6; it++ )
|
||||
@@ -293,7 +294,7 @@ diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
if (sparse_src)
|
||||
{
|
||||
bool normal_copy_required;
|
||||
@@ -1316,7 +1542,9 @@
|
||||
@@ -1316,7 +1543,9 @@
|
||||
if (extent_copy (source_desc, dest_desc, buf, buf_size, hole_size,
|
||||
src_open_sb.st_size,
|
||||
make_holes ? x->sparse_mode : SPARSE_NEVER,
|
||||
@@ -304,7 +305,7 @@ diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
goto preserve_metadata;
|
||||
|
||||
if (! normal_copy_required)
|
||||
@@ -1328,11 +1556,12 @@
|
||||
@@ -1328,11 +1557,12 @@
|
||||
|
||||
off_t n_read;
|
||||
bool wrote_hole_at_eof;
|
||||
@@ -320,7 +321,7 @@ diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
{
|
||||
return_val = false;
|
||||
goto close_src_and_dst_desc;
|
||||
@@ -1343,6 +1572,14 @@
|
||||
@@ -1343,6 +1573,14 @@
|
||||
return_val = false;
|
||||
goto close_src_and_dst_desc;
|
||||
}
|
||||
@@ -337,7 +338,7 @@ diff -aur coreutils-8.32/src/copy.c coreutils-8.32-patched/src/copy.c
|
||||
preserve_metadata:
|
||||
diff -aur coreutils-8.32/src/copy.h coreutils-8.32-patched/src/copy.h
|
||||
--- coreutils-8.32/src/copy.h 2020-01-01 19:43:12.000000000 +0530
|
||||
+++ coreutils-8.32-patched/src/copy.h 2020-10-26 19:27:11.298040234 +0530
|
||||
+++ coreutils-8.32-patched/src/copy.h 2020-12-06 22:24:03.488405684 +0530
|
||||
@@ -234,6 +234,9 @@
|
||||
Create destination directories as usual. */
|
||||
bool symbolic_link;
|
||||
@@ -366,7 +367,7 @@ diff -aur coreutils-8.32/src/copy.h coreutils-8.32-patched/src/copy.h
|
||||
#endif
|
||||
diff -aur coreutils-8.32/src/cp.c coreutils-8.32-patched/src/cp.c
|
||||
--- coreutils-8.32/src/cp.c 2020-01-01 19:43:12.000000000 +0530
|
||||
+++ coreutils-8.32-patched/src/cp.c 2020-10-26 19:27:11.298040234 +0530
|
||||
+++ coreutils-8.32-patched/src/cp.c 2020-12-06 22:24:03.488405684 +0530
|
||||
@@ -131,6 +131,7 @@
|
||||
{"symbolic-link", no_argument, NULL, 's'},
|
||||
{"target-directory", required_argument, NULL, 't'},
|
||||
@@ -531,7 +532,7 @@ diff -aur coreutils-8.32/src/cp.c coreutils-8.32-patched/src/cp.c
|
||||
break;
|
||||
diff -aur coreutils-8.32/src/mv.c coreutils-8.32-patched/src/mv.c
|
||||
--- coreutils-8.32/src/mv.c 2020-01-01 19:43:12.000000000 +0530
|
||||
+++ coreutils-8.32-patched/src/mv.c 2020-10-26 19:27:11.298040234 +0530
|
||||
+++ coreutils-8.32-patched/src/mv.c 2020-12-06 22:24:03.488405684 +0530
|
||||
@@ -66,6 +66,7 @@
|
||||
{"target-directory", required_argument, NULL, 't'},
|
||||
{"update", no_argument, NULL, 'u'},
|
||||
|
||||
Reference in New Issue
Block a user