multibyte fixes in cut and expand (by M.Briza, #821260)
This commit is contained in:
parent
7bf4c1a1c5
commit
f856ee515a
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
+ }
|
||||
+ }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue