From f856ee515a29758bddd4b1788e442be670f2e8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= Date: Mon, 5 Nov 2012 16:01:01 +0100 Subject: [PATCH] multibyte fixes in cut and expand (by M.Briza, #821260) --- coreutils-i18n.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index e32e053..043f72b 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -376,7 +376,7 @@ diff -urNp coreutils-8.12-orig/src/cut.c coreutils-8.12/src/cut.c + break; + } + -+ if (wc == WEOF) ++ if (len<=0 && wc == WEOF) + break; + + /* If the first field extends to the end of line (it is not @@ -733,7 +733,7 @@ diff -urNp coreutils-8.12-orig/src/expand.c coreutils-8.12/src/expand.c + if (convert) + { + ++column; -+ if (convert_entire_line == 0) ++ if (convert_entire_line == 0 && !isblank(*bufpos)) + convert = 0; + } + putchar (*bufpos); @@ -793,7 +793,7 @@ diff -urNp coreutils-8.12-orig/src/expand.c coreutils-8.12/src/expand.c + + width = wcwidth (wc); + column += (width > 0) ? width : 0; -+ if (convert_entire_line == 0) ++ if (convert_entire_line == 0 && !iswblank(wc)) + convert = 0; + } + }