diff --git a/coreutils-i18n-expand-unexpand.patch b/coreutils-i18n-expand-unexpand.patch index c901740..6cccdf6 100644 --- a/coreutils-i18n-expand-unexpand.patch +++ b/coreutils-i18n-expand-unexpand.patch @@ -588,18 +588,18 @@ index 7801274..569a7ee 100644 { /* Go back one column, and force recalculation of the next tab stop. */ -@@ -221,7 +235,9 @@ unexpand (void) +@@ -221,16 +235,20 @@ unexpand (void) } else { - column++; -+ /* mb_width() returns 0 for control characters */ -+ const int width = mb_width (c); -+ column += MAX(1, width); - if (!column) +- if (!column) ++ const uintmax_t orig_column = column; ++ column += mb_width (c); ++ if (column < orig_column) die (EXIT_FAILURE, 0, _("input line is too long")); } -@@ -229,8 +245,11 @@ unexpand (void) + if (pending) { if (pending > 1 && one_blank_before_tab_stop) @@ -613,7 +613,7 @@ index 7801274..569a7ee 100644 die (EXIT_FAILURE, errno, _("write error")); pending = 0; one_blank_before_tab_stop = false; -@@ -240,16 +259,17 @@ unexpand (void) +@@ -240,16 +258,17 @@ unexpand (void) convert &= convert_entire_line || blank; } diff --git a/coreutils-i18n-fix-unexpand.patch b/coreutils-i18n-fix-unexpand.patch deleted file mode 100644 index e9d69a1..0000000 --- a/coreutils-i18n-fix-unexpand.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 02424bfcd719bbaa695f4e1c3ef17ad91b0d23c0 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 28 Jan 2016 20:57:22 +0100 -Subject: [PATCH] unexpand: fix blank line handling - - echo '' |./src/unexpand -a - -Really? ---- - src/unexpand.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/unexpand.c b/src/unexpand.c -index 569a7ee..3bbbd66 100644 ---- a/src/unexpand.c -+++ b/src/unexpand.c -@@ -233,7 +233,7 @@ unexpand (void) - next_tab_column = column; - tab_index -= !!tab_index; - } -- else -+ else if (!mb_iseq (c, '\n')) - { - /* mb_width() returns 0 for control characters */ - const int width = mb_width (c); --- -2.7.4 - diff --git a/coreutils.spec b/coreutils.spec index 7877ccb..986a619 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 8.32 -Release: 35%{?dist} +Release: 36%{?dist} License: GPLv3+ Url: https://www.gnu.org/software/coreutils/ Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz @@ -97,8 +97,6 @@ Patch800: coreutils-i18n.patch Patch801: coreutils-i18n-expand-unexpand.patch # i18n patch for cut - old version - used Patch804: coreutils-i18n-cut-old.patch -# The unexpand patch above is not correct. Sent to the patch authors -Patch803: coreutils-i18n-fix-unexpand.patch #(un)expand - allow multiple files on input - broken by patch 801 Patch805: coreutils-i18n-fix2-expand-unexpand.patch #(un)expand - test BOM headers @@ -331,6 +329,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %license COPYING %changelog +* Mon Aug 08 2022 Kamil Dudka - 8.32-36 +- improve handling of control characters in unexpand (#2112870) + * Mon Aug 01 2022 Kamil Dudka - 8.32-35 - make the last fix actually effective (#2112870)