Changeset View
Changeset View
Standalone View
Standalone View
files/coreutils-8.27-i18n-1.patch
- This file was moved from files/coreutils-8.26-i18n-1.patch.
| Submitted by: DJ Lucas (dj_AT_linuxfromscratch_DOT_org) | Submitted by: DJ Lucas (dj_AT_linuxfromscratch_DOT_org) | ||||
| Date: 2016-12-03 | Date: 2017-03-12 | ||||
| Initial Package Version: 8.26 | Initial Package Version: 8.27 | ||||
| Upstream Status: Rejected | Upstream Status: Rejected | ||||
| Origin: Based on Suse's i18n patches at | Origin: Based on Fedora's i18n patches at | ||||
| https://build.opensuse.org/package/show/Base:System/coreutils/ | http://pkgs.fedoraproject.org/cgit/rpms/coreutils.git/tree/ | ||||
| Description: Fixes i18n issues with various Coreutils programs | Description: Fixes i18n issues with various Coreutils programs | ||||
| diff -Naurp coreutils-8.26-orig/bootstrap.conf coreutils-8.26/bootstrap.conf | diff -Naurp coreutils-8.27-orig/bootstrap.conf coreutils-8.27/bootstrap.conf | ||||
| --- coreutils-8.26-orig/bootstrap.conf 2016-11-06 16:15:29.000000000 -0600 | --- coreutils-8.27-orig/bootstrap.conf 2017-03-07 23:34:06.000000000 -0600 | ||||
| +++ coreutils-8.26/bootstrap.conf 2016-12-02 19:15:23.514391986 -0600 | +++ coreutils-8.27/bootstrap.conf 2017-03-11 23:47:38.068058445 -0600 | ||||
| @@ -152,6 +152,7 @@ gnulib_modules=" | @@ -152,6 +152,7 @@ gnulib_modules=" | ||||
| maintainer-makefile | maintainer-makefile | ||||
| malloc-gnu | malloc-gnu | ||||
| manywarnings | manywarnings | ||||
| + mbfile | + mbfile | ||||
| mbrlen | mbrlen | ||||
| mbrtowc | mbrtowc | ||||
| mbsalign | mbsalign | ||||
| diff -Naurp coreutils-8.26-orig/configure.ac coreutils-8.26/configure.ac | diff -Naurp coreutils-8.27-orig/configure.ac coreutils-8.27/configure.ac | ||||
| --- coreutils-8.26-orig/configure.ac 2016-11-29 12:03:45.000000000 -0600 | --- coreutils-8.27-orig/configure.ac 2017-02-26 08:52:29.000000000 -0600 | ||||
| +++ coreutils-8.26/configure.ac 2016-12-02 19:15:23.515391902 -0600 | +++ coreutils-8.27/configure.ac 2017-03-11 23:47:38.068058445 -0600 | ||||
| @@ -427,6 +427,8 @@ fi | @@ -429,6 +429,8 @@ fi | ||||
| # I'm leaving it here for now. This whole thing needs to be modernized... | # I'm leaving it here for now. This whole thing needs to be modernized... | ||||
| gl_WINSIZE_IN_PTEM | gl_WINSIZE_IN_PTEM | ||||
| +gl_MBFILE | +gl_MBFILE | ||||
| + | + | ||||
| gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H | gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H | ||||
| if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \ | if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \ | ||||
| diff -Naurp coreutils-8.26-orig/lib/linebuffer.h coreutils-8.26/lib/linebuffer.h | diff -Naurp coreutils-8.27-orig/lib/linebuffer.h coreutils-8.27/lib/linebuffer.h | ||||
| --- coreutils-8.26-orig/lib/linebuffer.h 2016-07-15 14:47:39.000000000 -0500 | --- coreutils-8.27-orig/lib/linebuffer.h 2017-01-01 16:35:38.000000000 -0600 | ||||
| +++ coreutils-8.26/lib/linebuffer.h 2016-12-02 19:15:23.515391902 -0600 | +++ coreutils-8.27/lib/linebuffer.h 2017-03-11 23:47:13.089286391 -0600 | ||||
| @@ -21,6 +21,11 @@ | @@ -21,6 +21,11 @@ | ||||
| # include <stdio.h> | # include <stdio.h> | ||||
| +/* Get mbstate_t. */ | +/* Get mbstate_t. */ | ||||
| +# if HAVE_WCHAR_H | +# if HAVE_WCHAR_H | ||||
| +# include <wchar.h> | +# include <wchar.h> | ||||
| +# endif | +# endif | ||||
| + | + | ||||
| /* A 'struct linebuffer' holds a line of text. */ | /* A 'struct linebuffer' holds a line of text. */ | ||||
| struct linebuffer | struct linebuffer | ||||
| @@ -28,6 +33,9 @@ struct linebuffer | @@ -28,6 +33,9 @@ struct linebuffer | ||||
| size_t size; /* Allocated. */ | size_t size; /* Allocated. */ | ||||
| size_t length; /* Used. */ | size_t length; /* Used. */ | ||||
| char *buffer; | char *buffer; | ||||
| +# if HAVE_WCHAR_H | +# if HAVE_WCHAR_H | ||||
| + mbstate_t state; | + mbstate_t state; | ||||
| +# endif | +# endif | ||||
| }; | }; | ||||
| /* Initialize linebuffer LINEBUFFER for use. */ | /* Initialize linebuffer LINEBUFFER for use. */ | ||||
| diff -Naurp coreutils-8.26-orig/lib/mbfile.c coreutils-8.26/lib/mbfile.c | diff -Naurp coreutils-8.27-orig/lib/mbfile.c coreutils-8.27/lib/mbfile.c | ||||
| --- coreutils-8.26-orig/lib/mbfile.c 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/lib/mbfile.c 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/lib/mbfile.c 2016-12-02 19:15:23.515391902 -0600 | +++ coreutils-8.27/lib/mbfile.c 2017-03-11 23:47:38.069058397 -0600 | ||||
| @@ -0,0 +1,3 @@ | @@ -0,0 +1,3 @@ | ||||
| +#include <config.h> | +#include <config.h> | ||||
| +#define MBFILE_INLINE _GL_EXTERN_INLINE | +#define MBFILE_INLINE _GL_EXTERN_INLINE | ||||
| +#include "mbfile.h" | +#include "mbfile.h" | ||||
| diff -Naurp coreutils-8.26-orig/lib/mbfile.h coreutils-8.26/lib/mbfile.h | diff -Naurp coreutils-8.27-orig/lib/mbfile.h coreutils-8.27/lib/mbfile.h | ||||
| --- coreutils-8.26-orig/lib/mbfile.h 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/lib/mbfile.h 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/lib/mbfile.h 2016-12-02 19:15:23.516391818 -0600 | +++ coreutils-8.27/lib/mbfile.h 2017-03-11 23:47:38.069058397 -0600 | ||||
| @@ -0,0 +1,255 @@ | @@ -0,0 +1,255 @@ | ||||
| +/* Multibyte character I/O: macros for multi-byte encodings. | +/* Multibyte character I/O: macros for multi-byte encodings. | ||||
| + Copyright (C) 2001, 2005, 2009-2015 Free Software Foundation, Inc. | + Copyright (C) 2001, 2005, 2009-2017 Free Software Foundation, Inc. | ||||
| + | + | ||||
| + This program is free software: you can redistribute it and/or modify | + This program is free software: you can redistribute it and/or modify | ||||
| + it under the terms of the GNU General Public License as published by | + it under the terms of the GNU General Public License as published by | ||||
| + the Free Software Foundation; either version 3 of the License, or | + the Free Software Foundation; either version 3 of the License, or | ||||
| + (at your option) any later version. | + (at your option) any later version. | ||||
| + | + | ||||
| + This program is distributed in the hope that it will be useful, | + This program is distributed in the hope that it will be useful, | ||||
| + but WITHOUT ANY WARRANTY; without even the implied warranty of | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| ▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | |||||
| +#define mb_iseof(mbc) ((mbc).bytes == 0) | +#define mb_iseof(mbc) ((mbc).bytes == 0) | ||||
| + | + | ||||
| +#ifndef _GL_INLINE_HEADER_BEGIN | +#ifndef _GL_INLINE_HEADER_BEGIN | ||||
| + #error "Please include config.h first." | + #error "Please include config.h first." | ||||
| +#endif | +#endif | ||||
| +_GL_INLINE_HEADER_BEGIN | +_GL_INLINE_HEADER_BEGIN | ||||
| + | + | ||||
| +#endif /* _MBFILE_H */ | +#endif /* _MBFILE_H */ | ||||
| diff -Naurp coreutils-8.26-orig/m4/mbfile.m4 coreutils-8.26/m4/mbfile.m4 | diff -Naurp coreutils-8.27-orig/m4/mbfile.m4 coreutils-8.27/m4/mbfile.m4 | ||||
| --- coreutils-8.26-orig/m4/mbfile.m4 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/m4/mbfile.m4 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/m4/mbfile.m4 2016-12-02 19:15:23.516391818 -0600 | +++ coreutils-8.27/m4/mbfile.m4 2017-03-11 23:47:38.070058349 -0600 | ||||
| @@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||||
| +# mbfile.m4 serial 7 | +# mbfile.m4 serial 7 | ||||
| +dnl Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc. | +dnl Copyright (C) 2005, 2008-2017 Free Software Foundation, Inc. | ||||
| +dnl This file is free software; the Free Software Foundation | +dnl This file is free software; the Free Software Foundation | ||||
| +dnl gives unlimited permission to copy and/or distribute it, | +dnl gives unlimited permission to copy and/or distribute it, | ||||
| +dnl with or without modifications, as long as this notice is preserved. | +dnl with or without modifications, as long as this notice is preserved. | ||||
| + | + | ||||
| +dnl autoconf tests required for use of mbfile.h | +dnl autoconf tests required for use of mbfile.h | ||||
| +dnl From Bruno Haible. | +dnl From Bruno Haible. | ||||
| + | + | ||||
| +AC_DEFUN([gl_MBFILE], | +AC_DEFUN([gl_MBFILE], | ||||
| +[ | +[ | ||||
| + AC_REQUIRE([AC_TYPE_MBSTATE_T]) | + AC_REQUIRE([AC_TYPE_MBSTATE_T]) | ||||
| + : | + : | ||||
| +]) | +]) | ||||
| diff -Naurp coreutils-8.26-orig/src/cut.c coreutils-8.26/src/cut.c | diff -Naurp coreutils-8.27-orig/src/cut.c coreutils-8.27/src/cut.c | ||||
| --- coreutils-8.26-orig/src/cut.c 2016-10-15 16:00:55.000000000 -0500 | --- coreutils-8.27-orig/src/cut.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/cut.c 2016-12-02 19:15:23.517391733 -0600 | +++ coreutils-8.27/src/cut.c 2017-03-11 23:47:59.526048471 -0600 | ||||
| @@ -28,6 +28,11 @@ | @@ -28,6 +28,11 @@ | ||||
| #include <assert.h> | #include <assert.h> | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| + | + | ||||
| +/* Get mbstate_t, mbrtowc(). */ | +/* Get mbstate_t, mbrtowc(). */ | ||||
| +#if HAVE_WCHAR_H | +#if HAVE_WCHAR_H | ||||
| +# include <wchar.h> | +# include <wchar.h> | ||||
| ▲ Show 20 Lines • Show All 545 Lines • ▼ Show 20 Lines | |||||
| + dummy[0] = delim; | + dummy[0] = delim; | ||||
| + dummy[1] = '\0'; | + dummy[1] = '\0'; | ||||
| + output_delimiter_string = dummy; | + output_delimiter_string = dummy; | ||||
| + output_delimiter_length = 1; | + output_delimiter_length = 1; | ||||
| + } | + } | ||||
| } | } | ||||
| if (optind == argc) | if (optind == argc) | ||||
| diff -Naurp coreutils-8.26-orig/src/expand.c coreutils-8.26/src/expand.c | diff -Naurp coreutils-8.27-orig/src/expand.c coreutils-8.27/src/expand.c | ||||
| --- coreutils-8.26-orig/src/expand.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/expand.c 2017-02-26 15:42:25.000000000 -0600 | ||||
| +++ coreutils-8.26/src/expand.c 2016-12-02 19:15:23.518391649 -0600 | +++ coreutils-8.27/src/expand.c 2017-03-11 23:49:06.758133530 -0600 | ||||
| @@ -37,6 +37,9 @@ | @@ -37,6 +37,9 @@ | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| + | + | ||||
| +#include <mbfile.h> | +#include <mbfile.h> | ||||
| + | + | ||||
| #include "system.h" | #include "system.h" | ||||
| ▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | |||||
| + if (ferror (stdout)) | + if (ferror (stdout)) | ||||
| die (EXIT_FAILURE, errno, _("write error")); | die (EXIT_FAILURE, errno, _("write error")); | ||||
| } | } | ||||
| - while (c != '\n'); | - while (c != '\n'); | ||||
| + while (!mb_iseq (c, '\n')); | + while (!mb_iseq (c, '\n')); | ||||
| } | } | ||||
| } | } | ||||
| diff -Naurp coreutils-8.26-orig/src/expand-common.c coreutils-8.26/src/expand-common.c | diff -Naurp coreutils-8.27-orig/src/expand-common.c coreutils-8.27/src/expand-common.c | ||||
| --- coreutils-8.26-orig/src/expand-common.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/expand-common.c 2017-03-01 11:22:55.000000000 -0600 | ||||
| +++ coreutils-8.26/src/expand-common.c 2016-12-02 19:15:23.518391649 -0600 | +++ coreutils-8.27/src/expand-common.c 2017-03-11 23:49:06.757133570 -0600 | ||||
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| +#include <mbfile.h> | +#include <mbfile.h> | ||||
| #include "system.h" | #include "system.h" | ||||
| #include "die.h" | #include "die.h" | ||||
| #include "error.h" | #include "error.h" | ||||
| @@ -85,6 +86,119 @@ add_tab_stop (uintmax_t tabval) | @@ -105,6 +106,119 @@ set_extend_size (uintmax_t tabval) | ||||
| } | return ok; | ||||
| } | } | ||||
| +extern int | +extern int | ||||
| +set_utf_locale (void) | +set_utf_locale (void) | ||||
| +{ | +{ | ||||
| + /*try using some predefined locale */ | + /*try using some predefined locale */ | ||||
| + const char* predef_locales[] = {"C.UTF8","en_US.UTF8","en_GB.UTF8"}; | + const char* predef_locales[] = {"C.UTF8","en_US.UTF8","en_GB.UTF8"}; | ||||
| + | + | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | |||||
| + putc (0xEF, stdout); | + putc (0xEF, stdout); | ||||
| + putc (0xBB, stdout); | + putc (0xBB, stdout); | ||||
| + putc (0xBF, stdout); | + putc (0xBF, stdout); | ||||
| +} | +} | ||||
| + | + | ||||
| /* Add the comma or blank separated list of tab stops STOPS | /* Add the comma or blank separated list of tab stops STOPS | ||||
| to the list of tab stops. */ | to the list of tab stops. */ | ||||
| extern void | extern void | ||||
| diff -Naurp coreutils-8.26-orig/src/expand-common.h coreutils-8.26/src/expand-common.h | diff -Naurp coreutils-8.27-orig/src/expand-common.h coreutils-8.27/src/expand-common.h | ||||
| --- coreutils-8.26-orig/src/expand-common.h 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/expand-common.h 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/expand-common.h 2016-12-02 19:15:23.518391649 -0600 | +++ coreutils-8.27/src/expand-common.h 2017-03-11 23:49:06.758133530 -0600 | ||||
| @@ -34,6 +34,18 @@ extern size_t max_column_width; | @@ -34,6 +34,18 @@ extern size_t max_column_width; | ||||
| /* The desired exit status. */ | /* The desired exit status. */ | ||||
| extern int exit_status; | extern int exit_status; | ||||
| +extern int | +extern int | ||||
| +set_utf_locale (void); | +set_utf_locale (void); | ||||
| + | + | ||||
| +extern bool | +extern bool | ||||
| +check_utf_locale(void); | +check_utf_locale(void); | ||||
| + | + | ||||
| +extern bool | +extern bool | ||||
| +check_bom(FILE* fp, mb_file_t *mbf); | +check_bom(FILE* fp, mb_file_t *mbf); | ||||
| + | + | ||||
| +extern void | +extern void | ||||
| +print_bom(void); | +print_bom(void); | ||||
| + | + | ||||
| /* Add tab stop TABVAL to the end of 'tab_list'. */ | /* Add tab stop TABVAL to the end of 'tab_list'. */ | ||||
| extern void | extern void | ||||
| add_tab_stop (uintmax_t tabval); | add_tab_stop (uintmax_t tabval); | ||||
| diff -Naurp coreutils-8.26-orig/src/fold.c coreutils-8.26/src/fold.c | diff -Naurp coreutils-8.27-orig/src/fold.c coreutils-8.27/src/fold.c | ||||
| --- coreutils-8.26-orig/src/fold.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/fold.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/fold.c 2016-12-02 19:15:23.519391564 -0600 | +++ coreutils-8.27/src/fold.c 2017-03-11 23:49:30.982169404 -0600 | ||||
| @@ -22,12 +22,34 @@ | @@ -22,12 +22,34 @@ | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| +/* Get mbstate_t, mbrtowc(), wcwidth(). */ | +/* Get mbstate_t, mbrtowc(), wcwidth(). */ | ||||
| +#if HAVE_WCHAR_H | +#if HAVE_WCHAR_H | ||||
| +# include <wchar.h> | +# include <wchar.h> | ||||
| +#endif | +#endif | ||||
| ▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | |||||
| + { | + { | ||||
| + line_out[offset_out++] = c; | + line_out[offset_out++] = c; | ||||
| + continue; | + continue; | ||||
| + } | + } | ||||
| + | + | ||||
| /* Look for the last blank. */ | /* Look for the last blank. */ | ||||
| while (logical_end) | while (logical_end) | ||||
| { | { | ||||
| @@ -215,11 +252,221 @@ fold_file (char const *filename, size_t | @@ -215,11 +252,220 @@ fold_file (char const *filename, size_t | ||||
| line_out[offset_out++] = c; | line_out[offset_out++] = c; | ||||
| } | } | ||||
| - saved_errno = errno; | - saved_errno = errno; | ||||
| + *saved_errno = errno; | + *saved_errno = errno; | ||||
| + | |||||
| if (offset_out) | + if (offset_out) | ||||
| fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); | + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); | ||||
| + | |||||
| +} | +} | ||||
| + | + | ||||
| +#if HAVE_MBRTOWC | +#if HAVE_MBRTOWC | ||||
| +static void | +static void | ||||
| +fold_multibyte_text (FILE *istream, size_t width, int *saved_errno) | +fold_multibyte_text (FILE *istream, size_t width, int *saved_errno) | ||||
| +{ | +{ | ||||
| + char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ | + char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */ | ||||
| + size_t buflen = 0; /* The length of the byte sequence in buf. */ | + size_t buflen = 0; /* The length of the byte sequence in buf. */ | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
| + /* Fall through. */ | + /* Fall through. */ | ||||
| + | + | ||||
| + case 0: | + case 0: | ||||
| + mblength = 1; | + mblength = 1; | ||||
| + break; | + break; | ||||
| + } | + } | ||||
| + | + | ||||
| +rescan: | +rescan: | ||||
| + if (operating_mode == byte_mode) /* byte mode */ | + if (convfail) | ||||
| + increment = 1; | |||||
| + else if (wc == L'\n') | |||||
| + { | |||||
| + /* preserve newline */ | |||||
| + fwrite (line_out, sizeof(char), offset_out, stdout); | |||||
| + START_NEW_LINE; | |||||
| + continue; | |||||
| + } | |||||
| + else if (operating_mode == byte_mode) /* byte mode */ | |||||
| + increment = mblength; | + increment = mblength; | ||||
| + else if (operating_mode == character_mode) /* character mode */ | + else if (operating_mode == character_mode) /* character mode */ | ||||
| + increment = 1; | + increment = 1; | ||||
| + else /* column mode */ | + else /* column mode */ | ||||
| + { | + { | ||||
| + if (convfail) | |||||
| + increment = 1; | |||||
| + else | |||||
| + { | |||||
| + switch (wc) | + switch (wc) | ||||
| + { | + { | ||||
| + case L'\n': | |||||
| + fwrite (line_out, sizeof(char), offset_out, stdout); | |||||
| + START_NEW_LINE; | |||||
| + continue; | |||||
| + | |||||
| + case L'\b': | + case L'\b': | ||||
| + increment = (column > 0) ? -1 : 0; | + increment = (column > 0) ? -1 : 0; | ||||
| + break; | + break; | ||||
| + | + | ||||
| + case L'\r': | + case L'\r': | ||||
| + increment = -1 * column; | + increment = -1 * column; | ||||
| + break; | + break; | ||||
| + | + | ||||
| + case L'\t': | + case L'\t': | ||||
| + increment = 8 - column % 8; | + increment = 8 - column % 8; | ||||
| + break; | + break; | ||||
| + | + | ||||
| + default: | + default: | ||||
| + increment = wcwidth (wc); | + increment = wcwidth (wc); | ||||
| + increment = (increment < 0) ? 0 : increment; | + increment = (increment < 0) ? 0 : increment; | ||||
| + } | + } | ||||
| + } | + } | ||||
| + } | |||||
| + | + | ||||
| + if (column + increment > width && break_spaces && last_blank_pos) | + if (column + increment > width && break_spaces && last_blank_pos) | ||||
| + { | + { | ||||
| + fwrite (line_out, sizeof(char), last_blank_pos, stdout); | + fwrite (line_out, sizeof(char), last_blank_pos, stdout); | ||||
| + putchar ('\n'); | + putchar ('\n'); | ||||
| + | + | ||||
| + offset_out = offset_out - last_blank_pos; | + offset_out = offset_out - last_blank_pos; | ||||
| + column = column - last_blank_column + ((is_cr_after_last_blank) | + column = column - last_blank_column + ((is_cr_after_last_blank) | ||||
| Show All 35 Lines | |||||
| + last_blank_increment = increment; | + last_blank_increment = increment; | ||||
| + is_bs_following_last_blank = 1; | + is_bs_following_last_blank = 1; | ||||
| + bs_following_last_blank_num = 0; | + bs_following_last_blank_num = 0; | ||||
| + is_cr_after_last_blank = 0; | + is_cr_after_last_blank = 0; | ||||
| + } | + } | ||||
| + } | + } | ||||
| + | + | ||||
| + *saved_errno = errno; | + *saved_errno = errno; | ||||
| + | |||||
| + if (offset_out) | if (offset_out) | ||||
| + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); | fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); | ||||
| + | |||||
| +} | +} | ||||
| +#endif | +#endif | ||||
| + | + | ||||
| +/* Fold file FILENAME, or standard input if FILENAME is "-", | +/* Fold file FILENAME, or standard input if FILENAME is "-", | ||||
| + to stdout, with maximum line length WIDTH. | + to stdout, with maximum line length WIDTH. | ||||
| + Return 0 if successful, 1 if an error occurs. */ | + Return 0 if successful, 1 if an error occurs. */ | ||||
| + | + | ||||
| +static bool | +static bool | ||||
| Show All 22 Lines | |||||
| + fold_multibyte_text (istream, width, &saved_errno); | + fold_multibyte_text (istream, width, &saved_errno); | ||||
| + else | + else | ||||
| +#endif | +#endif | ||||
| + fold_text (istream, width, &saved_errno); | + fold_text (istream, width, &saved_errno); | ||||
| + | + | ||||
| if (ferror (istream)) | if (ferror (istream)) | ||||
| { | { | ||||
| error (0, saved_errno, "%s", quotef (filename)); | error (0, saved_errno, "%s", quotef (filename)); | ||||
| @@ -252,7 +499,8 @@ main (int argc, char **argv) | @@ -252,7 +498,8 @@ main (int argc, char **argv) | ||||
| atexit (close_stdout); | atexit (close_stdout); | ||||
| - break_spaces = count_bytes = have_read_stdin = false; | - break_spaces = count_bytes = have_read_stdin = false; | ||||
| + operating_mode = column_mode; | + operating_mode = column_mode; | ||||
| + break_spaces = have_read_stdin = false; | + break_spaces = have_read_stdin = false; | ||||
| while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) | while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) | ||||
| { | { | ||||
| @@ -261,7 +509,15 @@ main (int argc, char **argv) | @@ -261,7 +508,15 @@ main (int argc, char **argv) | ||||
| switch (optc) | switch (optc) | ||||
| { | { | ||||
| case 'b': /* Count bytes rather than columns. */ | case 'b': /* Count bytes rather than columns. */ | ||||
| - count_bytes = true; | - count_bytes = true; | ||||
| + if (operating_mode != column_mode) | + if (operating_mode != column_mode) | ||||
| + FATAL_ERROR (_("only one way of folding may be specified")); | + FATAL_ERROR (_("only one way of folding may be specified")); | ||||
| + operating_mode = byte_mode; | + operating_mode = byte_mode; | ||||
| + break; | + break; | ||||
| + | + | ||||
| + case 'c': | + case 'c': | ||||
| + if (operating_mode != column_mode) | + if (operating_mode != column_mode) | ||||
| + FATAL_ERROR (_("only one way of folding may be specified")); | + FATAL_ERROR (_("only one way of folding may be specified")); | ||||
| + operating_mode = character_mode; | + operating_mode = character_mode; | ||||
| break; | break; | ||||
| case 's': /* Break at word boundaries. */ | case 's': /* Break at word boundaries. */ | ||||
| diff -Naurp coreutils-8.26-orig/src/join.c coreutils-8.26/src/join.c | diff -Naurp coreutils-8.27-orig/src/join.c coreutils-8.27/src/join.c | ||||
| --- coreutils-8.26-orig/src/join.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/join.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/join.c 2016-12-02 19:15:23.520391480 -0600 | +++ coreutils-8.27/src/join.c 2017-03-11 23:47:13.091286290 -0600 | ||||
| @@ -22,19 +22,33 @@ | @@ -22,19 +22,33 @@ | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| +/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */ | +/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */ | ||||
| +#if HAVE_WCHAR_H | +#if HAVE_WCHAR_H | ||||
| +# include <wchar.h> | +# include <wchar.h> | ||||
| +#endif | +#endif | ||||
| ▲ Show 20 Lines • Show All 473 Lines • ▼ Show 20 Lines | + die (EXIT_FAILURE, 0, _("incompatible tabs")); | ||||
| } | } | ||||
| - if (0 <= tab && tab != newtab) | - if (0 <= tab && tab != newtab) | ||||
| - die (EXIT_FAILURE, 0, _("incompatible tabs")); | - die (EXIT_FAILURE, 0, _("incompatible tabs")); | ||||
| tab = newtab; | tab = newtab; | ||||
| + tablen = newtablen; | + tablen = newtablen; | ||||
| } | } | ||||
| break; | break; | ||||
| diff -Naurp coreutils-8.26-orig/src/pr.c coreutils-8.26/src/pr.c | diff -Naurp coreutils-8.27-orig/src/pr.c coreutils-8.27/src/pr.c | ||||
| --- coreutils-8.26-orig/src/pr.c 2016-11-25 07:40:49.000000000 -0600 | --- coreutils-8.27-orig/src/pr.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/pr.c 2016-12-02 19:15:23.522391311 -0600 | +++ coreutils-8.27/src/pr.c 2017-03-11 23:47:13.094286139 -0600 | ||||
| @@ -311,6 +311,24 @@ | @@ -311,6 +311,24 @@ | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| + | + | ||||
| +/* Get MB_LEN_MAX. */ | +/* Get MB_LEN_MAX. */ | ||||
| +#include <limits.h> | +#include <limits.h> | ||||
| +/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC | +/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC | ||||
| ▲ Show 20 Lines • Show All 746 Lines • ▼ Show 20 Lines | |||||
| + | + | ||||
| + return chars; | + return chars; | ||||
| +} | +} | ||||
| +#endif | +#endif | ||||
| + | + | ||||
| /* We've just printed some files and need to clean up things before | /* We've just printed some files and need to clean up things before | ||||
| looking for more options and printing the next batch of files. | looking for more options and printing the next batch of files. | ||||
| diff -Naurp coreutils-8.26-orig/src/sort.c coreutils-8.26/src/sort.c | diff -Naurp coreutils-8.27-orig/src/sort.c coreutils-8.27/src/sort.c | ||||
| --- coreutils-8.26-orig/src/sort.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/sort.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/sort.c 2016-12-02 19:15:23.525391058 -0600 | +++ coreutils-8.27/src/sort.c 2017-03-11 23:49:22.416505389 -0600 | ||||
| @@ -29,6 +29,14 @@ | @@ -29,6 +29,14 @@ | ||||
| #include <sys/wait.h> | #include <sys/wait.h> | ||||
| #include <signal.h> | #include <signal.h> | ||||
| #include <assert.h> | #include <assert.h> | ||||
| +#if HAVE_WCHAR_H | +#if HAVE_WCHAR_H | ||||
| +# include <wchar.h> | +# include <wchar.h> | ||||
| +#endif | +#endif | ||||
| +/* Get isw* functions. */ | +/* Get isw* functions. */ | ||||
| ▲ Show 20 Lines • Show All 1,011 Lines • ▼ Show 20 Lines | -#ifdef lint | ||||
| if (files_from) | if (files_from) | ||||
| readtokens0_free (&tok); | readtokens0_free (&tok); | ||||
| else | else | ||||
| free (files); | free (files); | ||||
| -#endif | -#endif | ||||
| if (have_read_stdin && fclose (stdin) == EOF) | if (have_read_stdin && fclose (stdin) == EOF) | ||||
| sort_die (_("close failed"), "-"); | sort_die (_("close failed"), "-"); | ||||
| diff -Naurp coreutils-8.26-orig/src/unexpand.c coreutils-8.26/src/unexpand.c | diff -Naurp coreutils-8.27-orig/src/unexpand.c coreutils-8.27/src/unexpand.c | ||||
| --- coreutils-8.26-orig/src/unexpand.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/unexpand.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/unexpand.c 2016-12-02 19:15:23.525391058 -0600 | +++ coreutils-8.27/src/unexpand.c 2017-03-11 23:49:06.758133530 -0600 | ||||
| @@ -38,6 +38,9 @@ | @@ -38,6 +38,9 @@ | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| + | + | ||||
| +#include <mbfile.h> | +#include <mbfile.h> | ||||
| + | + | ||||
| #include "system.h" | #include "system.h" | ||||
| ▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | |||||
| + if (ferror (stdout)) | + if (ferror (stdout)) | ||||
| die (EXIT_FAILURE, errno, _("write error")); | die (EXIT_FAILURE, errno, _("write error")); | ||||
| } | } | ||||
| - while (c != '\n'); | - while (c != '\n'); | ||||
| + while (!mb_iseq (c, '\n')); | + while (!mb_iseq (c, '\n')); | ||||
| } | } | ||||
| } | } | ||||
| diff -Naurp coreutils-8.26-orig/src/uniq.c coreutils-8.26/src/uniq.c | diff -Naurp coreutils-8.27-orig/src/uniq.c coreutils-8.27/src/uniq.c | ||||
| --- coreutils-8.26-orig/src/uniq.c 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/src/uniq.c 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/src/uniq.c 2016-12-02 19:15:23.526390974 -0600 | +++ coreutils-8.27/src/uniq.c 2017-03-11 23:47:13.098285938 -0600 | ||||
| @@ -21,6 +21,17 @@ | @@ -21,6 +21,17 @@ | ||||
| #include <getopt.h> | #include <getopt.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| +/* Get mbstate_t, mbrtowc(). */ | +/* Get mbstate_t, mbrtowc(). */ | ||||
| +#if HAVE_WCHAR_H | +#if HAVE_WCHAR_H | ||||
| +# include <wchar.h> | +# include <wchar.h> | ||||
| +#endif | +#endif | ||||
| ▲ Show 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | |||||
| + find_field = find_field_uni; | + find_field = find_field_uni; | ||||
| + } | + } | ||||
| + | + | ||||
| + | + | ||||
| + | + | ||||
| skip_chars = 0; | skip_chars = 0; | ||||
| skip_fields = 0; | skip_fields = 0; | ||||
| check_chars = SIZE_MAX; | check_chars = SIZE_MAX; | ||||
| diff -Naurp coreutils-8.26-orig/tests/expand/mb.sh coreutils-8.26/tests/expand/mb.sh | diff -Naurp coreutils-8.27-orig/tests/expand/mb.sh coreutils-8.27/tests/expand/mb.sh | ||||
| --- coreutils-8.26-orig/tests/expand/mb.sh 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/tests/expand/mb.sh 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/expand/mb.sh 2016-12-02 19:15:23.526390974 -0600 | +++ coreutils-8.27/tests/expand/mb.sh 2017-03-11 23:49:06.759133489 -0600 | ||||
| @@ -0,0 +1,183 @@ | @@ -0,0 +1,183 @@ | ||||
| +#!/bin/sh | +#!/bin/sh | ||||
| + | + | ||||
| +# Copyright (C) 2012-2015 Free Software Foundation, Inc. | +# Copyright (C) 2012-2017 Free Software Foundation, Inc. | ||||
| + | + | ||||
| +# This program is free software: you can redistribute it and/or modify | +# This program is free software: you can redistribute it and/or modify | ||||
| +# it under the terms of the GNU General Public License as published by | +# it under the terms of the GNU General Public License as published by | ||||
| +# the Free Software Foundation, either version 3 of the License, or | +# the Free Software Foundation, either version 3 of the License, or | ||||
| +# (at your option) any later version. | +# (at your option) any later version. | ||||
| + | + | ||||
| +# This program is distributed in the hope that it will be useful, | +# This program is distributed in the hope that it will be useful, | ||||
| +# but WITHOUT ANY WARRANTY; without even the implied warranty of | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| ▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | |||||
| + | + | ||||
| +LANG=C expand in1 in1 > out || fail=1 | +LANG=C expand in1 in1 > out || fail=1 | ||||
| +compare exp out > /dev/null 2>&1 || fail=1 | +compare exp out > /dev/null 2>&1 || fail=1 | ||||
| + | + | ||||
| +LC_ALL=C expand in1 in1 > out || fail=1 | +LC_ALL=C expand in1 in1 > out || fail=1 | ||||
| +compare exp out > /dev/null 2>&1 || fail=1 | +compare exp out > /dev/null 2>&1 || fail=1 | ||||
| + | + | ||||
| +exit $fail | +exit $fail | ||||
| diff -Naurp coreutils-8.26-orig/tests/i18n/sort.sh coreutils-8.26/tests/i18n/sort.sh | diff -Naurp coreutils-8.27-orig/tests/i18n/sort.sh coreutils-8.27/tests/i18n/sort.sh | ||||
| --- coreutils-8.26-orig/tests/i18n/sort.sh 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/tests/i18n/sort.sh 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/i18n/sort.sh 2016-12-02 19:15:23.527390889 -0600 | +++ coreutils-8.27/tests/i18n/sort.sh 2017-03-11 23:47:13.100285838 -0600 | ||||
| @@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||||
| +#!/bin/sh | +#!/bin/sh | ||||
| +# Verify sort's multi-byte support. | +# Verify sort's multi-byte support. | ||||
| + | + | ||||
| +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src | +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src | ||||
| +print_ver_ sort | +print_ver_ sort | ||||
| + | + | ||||
| +export LC_ALL=en_US.UTF-8 | +export LC_ALL=en_US.UTF-8 | ||||
| Show All 14 Lines | |||||
| +cat <<EOF | sort -f > out || fail=1 | +cat <<EOF | sort -f > out || fail=1 | ||||
| +. | +. | ||||
| +ɑ | +ɑ | ||||
| +EOF | +EOF | ||||
| +compare exp out || { fail=1; cat out; } | +compare exp out || { fail=1; cat out; } | ||||
| + | + | ||||
| + | + | ||||
| +Exit $fail | +Exit $fail | ||||
| diff -Naurp coreutils-8.26-orig/tests/local.mk coreutils-8.26/tests/local.mk | diff -Naurp coreutils-8.27-orig/tests/local.mk coreutils-8.27/tests/local.mk | ||||
| --- coreutils-8.26-orig/tests/local.mk 2016-11-22 14:04:32.000000000 -0600 | --- coreutils-8.27-orig/tests/local.mk 2017-02-28 22:25:37.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/local.mk 2016-12-02 19:15:23.527390889 -0600 | +++ coreutils-8.27/tests/local.mk 2017-03-11 23:47:38.072058253 -0600 | ||||
| @@ -350,6 +350,8 @@ all_tests = \ | @@ -352,6 +352,8 @@ all_tests = \ | ||||
| tests/misc/sort-discrim.sh \ | tests/misc/sort-discrim.sh \ | ||||
| tests/misc/sort-files0-from.pl \ | tests/misc/sort-files0-from.pl \ | ||||
| tests/misc/sort-float.sh \ | tests/misc/sort-float.sh \ | ||||
| + tests/misc/sort-mb-tests.sh \ | + tests/misc/sort-mb-tests.sh \ | ||||
| + tests/i18n/sort.sh \ | + tests/i18n/sort.sh \ | ||||
| tests/misc/sort-h-thousands-sep.sh \ | tests/misc/sort-h-thousands-sep.sh \ | ||||
| tests/misc/sort-merge.pl \ | tests/misc/sort-merge.pl \ | ||||
| tests/misc/sort-merge-fdlimit.sh \ | tests/misc/sort-merge-fdlimit.sh \ | ||||
| @@ -542,6 +544,7 @@ all_tests = \ | @@ -544,6 +546,7 @@ all_tests = \ | ||||
| tests/du/threshold.sh \ | tests/du/threshold.sh \ | ||||
| tests/du/trailing-slash.sh \ | tests/du/trailing-slash.sh \ | ||||
| tests/du/two-args.sh \ | tests/du/two-args.sh \ | ||||
| + tests/expand/mb.sh \ | + tests/expand/mb.sh \ | ||||
| tests/id/gnu-zero-uids.sh \ | tests/id/gnu-zero-uids.sh \ | ||||
| tests/id/no-context.sh \ | tests/id/no-context.sh \ | ||||
| tests/id/context.sh \ | tests/id/context.sh \ | ||||
| @@ -682,6 +685,7 @@ all_tests = \ | @@ -684,6 +687,7 @@ all_tests = \ | ||||
| tests/touch/read-only.sh \ | tests/touch/read-only.sh \ | ||||
| tests/touch/relative.sh \ | tests/touch/relative.sh \ | ||||
| tests/touch/trailing-slash.sh \ | tests/touch/trailing-slash.sh \ | ||||
| + tests/unexpand/mb.sh \ | + tests/unexpand/mb.sh \ | ||||
| $(all_root_tests) | $(all_root_tests) | ||||
| # See tests/factor/create-test.sh. | # See tests/factor/create-test.sh. | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/cut.pl coreutils-8.26/tests/misc/cut.pl | diff -Naurp coreutils-8.27-orig/tests/misc/cut.pl coreutils-8.27/tests/misc/cut.pl | ||||
| --- coreutils-8.26-orig/tests/misc/cut.pl 2016-03-16 07:21:24.000000000 -0500 | --- coreutils-8.27-orig/tests/misc/cut.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/cut.pl 2016-12-02 19:15:23.527390889 -0600 | +++ coreutils-8.27/tests/misc/cut.pl 2017-03-11 23:47:13.100285838 -0600 | ||||
| @@ -23,9 +23,11 @@ use strict; | @@ -23,9 +23,11 @@ use strict; | ||||
| # Turn off localization of executable's output. | # Turn off localization of executable's output. | ||||
| @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | ||||
| -my $mb_locale = $ENV{LOCALE_FR_UTF8}; | -my $mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| +my $mb_locale; | +my $mb_locale; | ||||
| +# uncommented enable multibyte paths | +# uncommented enable multibyte paths | ||||
| +$mb_locale = $ENV{LOCALE_FR_UTF8}; | +$mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| ! defined $mb_locale || $mb_locale eq 'none' | ! defined $mb_locale || $mb_locale eq 'none' | ||||
| - and $mb_locale = 'C'; | - and $mb_locale = 'C'; | ||||
| + and $mb_locale = 'C'; | + and $mb_locale = 'C'; | ||||
| my $prog = 'cut'; | my $prog = 'cut'; | ||||
| my $try = "Try '$prog --help' for more information.\n"; | my $try = "Try '$prog --help' for more information.\n"; | ||||
| @@ -240,6 +242,7 @@ if ($mb_locale ne 'C') | @@ -240,6 +242,7 @@ if ($mb_locale ne 'C') | ||||
| my @new_t = @$t; | my @new_t = @$t; | ||||
| my $test_name = shift @new_t; | my $test_name = shift @new_t; | ||||
| + next if ($test_name =~ "newline-[12][0-9]"); | + next if ($test_name =~ "newline-[12][0-9]"); | ||||
| push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; | push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; | ||||
| } | } | ||||
| push @Tests, @new; | push @Tests, @new; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/expand.pl coreutils-8.26/tests/misc/expand.pl | diff -Naurp coreutils-8.27-orig/tests/misc/expand.pl coreutils-8.27/tests/misc/expand.pl | ||||
| --- coreutils-8.26-orig/tests/misc/expand.pl 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/tests/misc/expand.pl 2017-03-01 11:16:46.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/expand.pl 2016-12-02 19:15:23.528390805 -0600 | +++ coreutils-8.27/tests/misc/expand.pl 2017-03-11 23:47:13.101285788 -0600 | ||||
| @@ -27,6 +27,15 @@ my $prog = 'expand'; | @@ -27,6 +27,15 @@ my $prog = 'expand'; | ||||
| # Turn off localization of executable's output. | # Turn off localization of executable's output. | ||||
| @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | ||||
| +#comment out next line to disable multibyte tests | +#comment out next line to disable multibyte tests | ||||
| +my $mb_locale = $ENV{LOCALE_FR_UTF8}; | +my $mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| +! defined $mb_locale || $mb_locale eq 'none' | +! defined $mb_locale || $mb_locale eq 'none' | ||||
| + and $mb_locale = 'C'; | + and $mb_locale = 'C'; | ||||
| + | + | ||||
| +my $prog = 'expand'; | +my $prog = 'expand'; | ||||
| +my $try = "Try \`$prog --help' for more information.\n"; | +my $try = "Try \`$prog --help' for more information.\n"; | ||||
| +my $inval = "$prog: invalid byte, character or field list\n$try"; | +my $inval = "$prog: invalid byte, character or field list\n$try"; | ||||
| + | + | ||||
| my @Tests = | my @Tests = | ||||
| ( | ( | ||||
| ['t1', '--tabs=3', {IN=>"a\tb"}, {OUT=>"a b"}], | ['t1', '--tabs=3', {IN=>"a\tb"}, {OUT=>"a b"}], | ||||
| @@ -140,6 +149,8 @@ my @Tests = | @@ -152,6 +161,8 @@ my @Tests = | ||||
| ['trail9', '--tab=1,2 -t/5',{IN=>"\ta\tb\tc"}, {OUT=>" a b c"}], | |||||
| # Test errors | # Test errors | ||||
| + # FIXME: The following tests contain ‘quoting’ specific to LC_MESSAGES | + # FIXME: The following tests contain ‘quoting’ specific to LC_MESSAGES | ||||
| + # So we force LC_MESSAGES=C to make them pass. | + # So we force LC_MESSAGES=C to make them pass. | ||||
| ['e1', '--tabs="a"', {IN=>''}, {OUT=>''}, {EXIT=>1}, | ['e1', '--tabs="a"', {IN=>''}, {OUT=>''}, {EXIT=>1}, | ||||
| {ERR => "$prog: tab size contains invalid character(s): 'a'\n"}], | {ERR => "$prog: tab size contains invalid character(s): 'a'\n"}], | ||||
| ['e2', "-t $UINTMAX_OFLOW", {IN=>''}, {OUT=>''}, {EXIT=>1}, | ['e2', "-t $UINTMAX_OFLOW", {IN=>''}, {OUT=>''}, {EXIT=>1}, | ||||
| @@ -150,6 +161,37 @@ my @Tests = | @@ -168,6 +179,37 @@ my @Tests = | ||||
| {ERR => "$prog: tab sizes must be ascending\n"}], | {ERR => "$prog: '/' specifier not at start of number: '/'\n"}], | ||||
| ); | ); | ||||
| +if ($mb_locale ne 'C') | +if ($mb_locale ne 'C') | ||||
| + { | + { | ||||
| + # Duplicate each test vector, appending "-mb" to the test name and | + # Duplicate each test vector, appending "-mb" to the test name and | ||||
| + # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we | + # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we | ||||
| + # provide coverage for the distro-added multi-byte code paths. | + # provide coverage for the distro-added multi-byte code paths. | ||||
| + my @new; | + my @new; | ||||
| Show All 20 Lines | |||||
| + } | + } | ||||
| + | + | ||||
| + | + | ||||
| +@Tests = triple_test \@Tests; | +@Tests = triple_test \@Tests; | ||||
| + | + | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/fold.pl coreutils-8.26/tests/misc/fold.pl | diff -Naurp coreutils-8.27-orig/tests/misc/fold.pl coreutils-8.27/tests/misc/fold.pl | ||||
| --- coreutils-8.26-orig/tests/misc/fold.pl 2016-03-16 07:21:24.000000000 -0500 | --- coreutils-8.27-orig/tests/misc/fold.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/fold.pl 2016-12-02 19:15:23.528390805 -0600 | +++ coreutils-8.27/tests/misc/fold.pl 2017-03-11 23:47:13.101285788 -0600 | ||||
| @@ -20,9 +20,18 @@ use strict; | @@ -20,9 +20,18 @@ use strict; | ||||
| (my $program_name = $0) =~ s|.*/||; | (my $program_name = $0) =~ s|.*/||; | ||||
| +my $prog = 'fold'; | +my $prog = 'fold'; | ||||
| +my $try = "Try \`$prog --help' for more information.\n"; | +my $try = "Try \`$prog --help' for more information.\n"; | ||||
| +my $inval = "$prog: invalid byte, character or field list\n$try"; | +my $inval = "$prog: invalid byte, character or field list\n$try"; | ||||
| + | + | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
| +@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | +@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | ||||
| + | + | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| -my $prog = 'fold'; | -my $prog = 'fold'; | ||||
| my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); | my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); | ||||
| exit $fail; | exit $fail; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/join.pl coreutils-8.26/tests/misc/join.pl | diff -Naurp coreutils-8.27-orig/tests/misc/join.pl coreutils-8.27/tests/misc/join.pl | ||||
| --- coreutils-8.26-orig/tests/misc/join.pl 2016-03-16 07:21:24.000000000 -0500 | --- coreutils-8.27-orig/tests/misc/join.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/join.pl 2016-12-02 19:15:23.528390805 -0600 | +++ coreutils-8.27/tests/misc/join.pl 2017-03-11 23:47:13.102285737 -0600 | ||||
| @@ -25,6 +25,15 @@ my $limits = getlimits (); | @@ -25,6 +25,15 @@ my $limits = getlimits (); | ||||
| my $prog = 'join'; | my $prog = 'join'; | ||||
| +my $try = "Try \`$prog --help' for more information.\n"; | +my $try = "Try \`$prog --help' for more information.\n"; | ||||
| +my $inval = "$prog: invalid byte, character or field list\n$try"; | +my $inval = "$prog: invalid byte, character or field list\n$try"; | ||||
| + | + | ||||
| +my $mb_locale; | +my $mb_locale; | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
| @Tests = triple_test \@Tests; | @Tests = triple_test \@Tests; | ||||
| +#skip invalid-j-mb test, it is failing because of the format | +#skip invalid-j-mb test, it is failing because of the format | ||||
| +@Tests = grep {$_->[0] ne 'invalid-j-mb'} @Tests; | +@Tests = grep {$_->[0] ne 'invalid-j-mb'} @Tests; | ||||
| + | + | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/sort-mb-tests.sh coreutils-8.26/tests/misc/sort-mb-tests.sh | diff -Naurp coreutils-8.27-orig/tests/misc/sort-mb-tests.sh coreutils-8.27/tests/misc/sort-mb-tests.sh | ||||
| --- coreutils-8.26-orig/tests/misc/sort-mb-tests.sh 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/tests/misc/sort-mb-tests.sh 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/sort-mb-tests.sh 2016-12-02 19:15:23.528390805 -0600 | +++ coreutils-8.27/tests/misc/sort-mb-tests.sh 2017-03-11 23:47:13.102285737 -0600 | ||||
| @@ -0,0 +1,45 @@ | @@ -0,0 +1,45 @@ | ||||
| +#!/bin/sh | +#!/bin/sh | ||||
| +# Verify sort's multi-byte support. | +# Verify sort's multi-byte support. | ||||
| + | + | ||||
| +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src | +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src | ||||
| +print_ver_ sort | +print_ver_ sort | ||||
| + | + | ||||
| +export LC_ALL=en_US.UTF-8 | +export LC_ALL=en_US.UTF-8 | ||||
| Show All 30 Lines | |||||
| +Banana@AA5@@30 | +Banana@AA5@@30 | ||||
| +Citrus@AA20@@5 | +Citrus@AA20@@5 | ||||
| +Cherry@AA30@@10 | +Cherry@AA30@@10 | ||||
| +EOF | +EOF | ||||
| + | + | ||||
| +compare exp out || { fail=1; cat out; } | +compare exp out || { fail=1; cat out; } | ||||
| + | + | ||||
| +Exit $fail | +Exit $fail | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/sort-merge.pl coreutils-8.26/tests/misc/sort-merge.pl | diff -Naurp coreutils-8.27-orig/tests/misc/sort-merge.pl coreutils-8.27/tests/misc/sort-merge.pl | ||||
| --- coreutils-8.26-orig/tests/misc/sort-merge.pl 2016-03-16 07:21:24.000000000 -0500 | --- coreutils-8.27-orig/tests/misc/sort-merge.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/sort-merge.pl 2016-12-02 19:15:23.529390720 -0600 | +++ coreutils-8.27/tests/misc/sort-merge.pl 2017-03-11 23:47:13.102285737 -0600 | ||||
| @@ -26,6 +26,15 @@ my $prog = 'sort'; | @@ -26,6 +26,15 @@ my $prog = 'sort'; | ||||
| # Turn off localization of executable's output. | # Turn off localization of executable's output. | ||||
| @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | ||||
| +my $mb_locale; | +my $mb_locale; | ||||
| +# uncommented according to upstream commit enabling multibyte paths | +# uncommented according to upstream commit enabling multibyte paths | ||||
| +$mb_locale = $ENV{LOCALE_FR_UTF8}; | +$mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| +! defined $mb_locale || $mb_locale eq 'none' | +! defined $mb_locale || $mb_locale eq 'none' | ||||
| Show All 40 Lines | |||||
| + push @Tests, @new; | + push @Tests, @new; | ||||
| + } | + } | ||||
| + | + | ||||
| +@Tests = triple_test \@Tests; | +@Tests = triple_test \@Tests; | ||||
| + | + | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/sort.pl coreutils-8.26/tests/misc/sort.pl | diff -Naurp coreutils-8.27-orig/tests/misc/sort.pl coreutils-8.27/tests/misc/sort.pl | ||||
| --- coreutils-8.26-orig/tests/misc/sort.pl 2016-03-16 07:21:24.000000000 -0500 | --- coreutils-8.27-orig/tests/misc/sort.pl 2017-01-21 08:53:43.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/sort.pl 2016-12-02 19:15:23.529390720 -0600 | +++ coreutils-8.27/tests/misc/sort.pl 2017-03-11 23:47:13.103285687 -0600 | ||||
| @@ -24,10 +24,15 @@ my $prog = 'sort'; | @@ -24,10 +24,15 @@ my $prog = 'sort'; | ||||
| # Turn off localization of executable's output. | # Turn off localization of executable's output. | ||||
| @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | ||||
| -my $mb_locale = $ENV{LOCALE_FR_UTF8}; | -my $mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| +my $mb_locale; | +my $mb_locale; | ||||
| +#Comment out next line to disable multibyte tests | +#Comment out next line to disable multibyte tests | ||||
| +$mb_locale = $ENV{LOCALE_FR_UTF8}; | +$mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| ! defined $mb_locale || $mb_locale eq 'none' | ! defined $mb_locale || $mb_locale eq 'none' | ||||
| and $mb_locale = 'C'; | and $mb_locale = 'C'; | ||||
| +my $try = "Try \`$prog --help' for more information.\n"; | +my $try = "Try \`$prog --help' for more information.\n"; | ||||
| +my $inval = "$prog: invalid byte, character or field list\n$try"; | +my $inval = "$prog: invalid byte, character or field list\n$try"; | ||||
| + | + | ||||
| # Since each test is run with a file name and with redirected stdin, | # Since each test is run with a file name and with redirected stdin, | ||||
| # the name in the diagnostic is either the file name or "-". | # the name in the diagnostic is either the file name or "-". | ||||
| # Normalize each diagnostic to use '-'. | # Normalize each diagnostic to use '-'. | ||||
| @@ -424,6 +429,38 @@ foreach my $t (@Tests) | @@ -423,6 +428,38 @@ foreach my $t (@Tests) | ||||
| } | } | ||||
| } | } | ||||
| +if ($mb_locale ne 'C') | +if ($mb_locale ne 'C') | ||||
| + { | + { | ||||
| + # Duplicate each test vector, appending "-mb" to the test name and | + # Duplicate each test vector, appending "-mb" to the test name and | ||||
| + # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we | + # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we | ||||
| + # provide coverage for the distro-added multi-byte code paths. | + # provide coverage for the distro-added multi-byte code paths. | ||||
| Show All 22 Lines | |||||
| + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; | + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; | ||||
| + } | + } | ||||
| + push @Tests, @new; | + push @Tests, @new; | ||||
| + } | + } | ||||
| + | + | ||||
| @Tests = triple_test \@Tests; | @Tests = triple_test \@Tests; | ||||
| # Remember that triple_test creates from each test with exactly one "IN" | # Remember that triple_test creates from each test with exactly one "IN" | ||||
| @@ -433,6 +470,7 @@ foreach my $t (@Tests) | @@ -432,6 +469,7 @@ foreach my $t (@Tests) | ||||
| # Remove the IN_PIPE version of the "output-is-input" test above. | # Remove the IN_PIPE version of the "output-is-input" test above. | ||||
| # The others aren't susceptible because they have three inputs each. | # The others aren't susceptible because they have three inputs each. | ||||
| @Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | @Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | ||||
| +@Tests = grep {$_->[0] ne 'output-is-input-mb.p'} @Tests; | +@Tests = grep {$_->[0] ne 'output-is-input-mb.p'} @Tests; | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/unexpand.pl coreutils-8.26/tests/misc/unexpand.pl | diff -Naurp coreutils-8.27-orig/tests/misc/unexpand.pl coreutils-8.27/tests/misc/unexpand.pl | ||||
| --- coreutils-8.26-orig/tests/misc/unexpand.pl 2016-11-06 16:15:30.000000000 -0600 | --- coreutils-8.27-orig/tests/misc/unexpand.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/unexpand.pl 2016-12-02 19:15:23.530390636 -0600 | +++ coreutils-8.27/tests/misc/unexpand.pl 2017-03-11 23:47:13.103285687 -0600 | ||||
| @@ -27,6 +27,14 @@ my $limits = getlimits (); | @@ -27,6 +27,14 @@ my $limits = getlimits (); | ||||
| my $prog = 'unexpand'; | my $prog = 'unexpand'; | ||||
| +# comment out next line to disable multibyte tests | +# comment out next line to disable multibyte tests | ||||
| +my $mb_locale = $ENV{LOCALE_FR_UTF8}; | +my $mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| +! defined $mb_locale || $mb_locale eq 'none' | +! defined $mb_locale || $mb_locale eq 'none' | ||||
| + and $mb_locale = 'C'; | + and $mb_locale = 'C'; | ||||
| Show All 37 Lines | |||||
| + push @Tests, @new; | + push @Tests, @new; | ||||
| + } | + } | ||||
| + | + | ||||
| +@Tests = triple_test \@Tests; | +@Tests = triple_test \@Tests; | ||||
| + | + | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| diff -Naurp coreutils-8.26-orig/tests/misc/uniq.pl coreutils-8.26/tests/misc/uniq.pl | diff -Naurp coreutils-8.27-orig/tests/misc/uniq.pl coreutils-8.27/tests/misc/uniq.pl | ||||
| --- coreutils-8.26-orig/tests/misc/uniq.pl 2016-03-16 07:21:24.000000000 -0500 | --- coreutils-8.27-orig/tests/misc/uniq.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/misc/uniq.pl 2016-12-02 19:15:23.530390636 -0600 | +++ coreutils-8.27/tests/misc/uniq.pl 2017-03-11 23:47:13.103285687 -0600 | ||||
| @@ -23,9 +23,17 @@ my $limits = getlimits (); | @@ -23,9 +23,17 @@ my $limits = getlimits (); | ||||
| my $prog = 'uniq'; | my $prog = 'uniq'; | ||||
| my $try = "Try '$prog --help' for more information.\n"; | my $try = "Try '$prog --help' for more information.\n"; | ||||
| +my $inval = "$prog: invalid byte, character or field list\n$try"; | +my $inval = "$prog: invalid byte, character or field list\n$try"; | ||||
| + | + | ||||
| # Turn off localization of executable's output. | # Turn off localization of executable's output. | ||||
| @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; | ||||
| ▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
| +# Remove the IN_PIPE version of the "output-is-input" test above. | +# Remove the IN_PIPE version of the "output-is-input" test above. | ||||
| +# The others aren't susceptible because they have three inputs each. | +# The others aren't susceptible because they have three inputs each. | ||||
| + | + | ||||
| +@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | +@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | ||||
| + | + | ||||
| @Tests = add_z_variants \@Tests; | @Tests = add_z_variants \@Tests; | ||||
| @Tests = triple_test \@Tests; | @Tests = triple_test \@Tests; | ||||
| diff -Naurp coreutils-8.26-orig/tests/pr/pr-tests.pl coreutils-8.26/tests/pr/pr-tests.pl | diff -Naurp coreutils-8.27-orig/tests/pr/pr-tests.pl coreutils-8.27/tests/pr/pr-tests.pl | ||||
| --- coreutils-8.26-orig/tests/pr/pr-tests.pl 2016-11-25 08:01:44.000000000 -0600 | --- coreutils-8.27-orig/tests/pr/pr-tests.pl 2017-01-01 16:34:24.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/pr/pr-tests.pl 2016-12-02 19:15:23.530390636 -0600 | +++ coreutils-8.27/tests/pr/pr-tests.pl 2017-03-11 23:47:13.103285687 -0600 | ||||
| @@ -24,6 +24,15 @@ use strict; | @@ -24,6 +24,15 @@ use strict; | ||||
| my $prog = 'pr'; | my $prog = 'pr'; | ||||
| my $normalize_strerror = "s/': .*/'/"; | my $normalize_strerror = "s/': .*/'/"; | ||||
| +my $mb_locale; | +my $mb_locale; | ||||
| +#Uncomment the following line to enable multibyte tests | +#Uncomment the following line to enable multibyte tests | ||||
| +$mb_locale = $ENV{LOCALE_FR_UTF8}; | +$mb_locale = $ENV{LOCALE_FR_UTF8}; | ||||
| +! defined $mb_locale || $mb_locale eq 'none' | +! defined $mb_locale || $mb_locale eq 'none' | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| +# due to a race condition about 1 in 20 times. | +# due to a race condition about 1 in 20 times. | ||||
| +# Remove the IN_PIPE version of the "output-is-input" test above. | +# Remove the IN_PIPE version of the "output-is-input" test above. | ||||
| +# The others aren't susceptible because they have three inputs each. | +# The others aren't susceptible because they have three inputs each. | ||||
| +@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | +@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; | ||||
| + | + | ||||
| my $save_temps = $ENV{DEBUG}; | my $save_temps = $ENV{DEBUG}; | ||||
| my $verbose = $ENV{VERBOSE}; | my $verbose = $ENV{VERBOSE}; | ||||
| diff -Naurp coreutils-8.26-orig/tests/unexpand/mb.sh coreutils-8.26/tests/unexpand/mb.sh | diff -Naurp coreutils-8.27-orig/tests/unexpand/mb.sh coreutils-8.27/tests/unexpand/mb.sh | ||||
| --- coreutils-8.26-orig/tests/unexpand/mb.sh 1969-12-31 18:00:00.000000000 -0600 | --- coreutils-8.27-orig/tests/unexpand/mb.sh 1969-12-31 18:00:00.000000000 -0600 | ||||
| +++ coreutils-8.26/tests/unexpand/mb.sh 2016-12-02 19:15:23.531390552 -0600 | +++ coreutils-8.27/tests/unexpand/mb.sh 2017-03-11 23:49:06.759133489 -0600 | ||||
| @@ -0,0 +1,172 @@ | @@ -0,0 +1,172 @@ | ||||
| +#!/bin/sh | +#!/bin/sh | ||||
| + | + | ||||
| +# Copyright (C) 2012-2015 Free Software Foundation, Inc. | +# Copyright (C) 2012-2017 Free Software Foundation, Inc. | ||||
| + | + | ||||
| +# This program is free software: you can redistribute it and/or modify | +# This program is free software: you can redistribute it and/or modify | ||||
| +# it under the terms of the GNU General Public License as published by | +# it under the terms of the GNU General Public License as published by | ||||
| +# the Free Software Foundation, either version 3 of the License, or | +# the Free Software Foundation, either version 3 of the License, or | ||||
| +# (at your option) any later version. | +# (at your option) any later version. | ||||
| + | + | ||||
| +# This program is distributed in the hope that it will be useful, | +# This program is distributed in the hope that it will be useful, | ||||
| +# but WITHOUT ANY WARRANTY; without even the implied warranty of | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| ▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.