From 9cdcd8d84547a7aa6cc51b240dabfe6a595785e8 Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Fri, 5 Jan 2024 21:31:11 +0100 Subject: [PATCH] automatic version update by autodist [release 8.23-1mamba;Tue Jul 22 2014] --- ...-i18n.patch => coreutils-8.23-i18n-1.patch | 652 ++++++++++-------- coreutils.spec | 9 +- 2 files changed, 361 insertions(+), 300 deletions(-) rename coreutils-8.22-i18n.patch => coreutils-8.23-i18n-1.patch (89%) diff --git a/coreutils-8.22-i18n.patch b/coreutils-8.23-i18n-1.patch similarity index 89% rename from coreutils-8.22-i18n.patch rename to coreutils-8.23-i18n-1.patch index 45ce918..eda68eb 100644 --- a/coreutils-8.22-i18n.patch +++ b/coreutils-8.23-i18n-1.patch @@ -1,6 +1,26 @@ -diff -urNp coreutils-8.22-orig/lib/linebuffer.h coreutils-8.22/lib/linebuffer.h ---- coreutils-8.22-orig/lib/linebuffer.h 2013-12-04 15:53:33.000000000 +0100 -+++ coreutils-8.22/lib/linebuffer.h 2013-12-16 17:40:25.933887985 +0100 +Submitted by: Matt Burgess (matthew_at_linuxfromscratch_dot_org) +Date: 2013-12-16 +Initial Package Version: 8.22 (Rebased for version 8.23 by bdubbs@linuxfromscratch.org)) +Upstream Status: Rejected +Origin: Based on Fedora's i18n patch at + http://pkgs.fedoraproject.org/cgit/coreutils.git/plain/coreutils-i18n.patch +Description: Fixes several i18n issues with various Coreutils programs + + +diff -Naur coreutils-8.23.orig/Makefile.in coreutils-8.23/Makefile.in +--- coreutils-8.23.orig/Makefile.in 2014-07-18 17:22:24.000000000 -0500 ++++ coreutils-8.23/Makefile.in 2014-07-18 22:36:17.404066931 -0500 +@@ -5057,6 +5057,7 @@ + tests/misc/chcon.sh \ + tests/misc/chroot-credentials.sh \ + tests/misc/selinux.sh \ ++ tests/misc/sort-mb-tests.sh \ + tests/misc/truncate-owned-by-other.sh \ + tests/mkdir/writable-under-readonly.sh \ + tests/mkdir/smack-root.sh \ +diff -Naur coreutils-8.23.orig/lib/linebuffer.h coreutils-8.23/lib/linebuffer.h +--- coreutils-8.23.orig/lib/linebuffer.h 2014-05-29 07:05:50.000000000 -0500 ++++ coreutils-8.23/lib/linebuffer.h 2014-07-18 22:36:17.392067256 -0500 @@ -21,6 +21,11 @@ # include @@ -13,7 +33,7 @@ diff -urNp coreutils-8.22-orig/lib/linebuffer.h coreutils-8.22/lib/linebuffer.h /* A 'struct linebuffer' holds a line of text. */ struct linebuffer -@@ -28,6 +33,9 @@ struct linebuffer +@@ -28,6 +33,9 @@ size_t size; /* Allocated. */ size_t length; /* Used. */ char *buffer; @@ -23,9 +43,9 @@ diff -urNp coreutils-8.22-orig/lib/linebuffer.h coreutils-8.22/lib/linebuffer.h }; /* Initialize linebuffer LINEBUFFER for use. */ -diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c ---- coreutils-8.22-orig/src/cut.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/cut.c 2013-12-16 17:40:25.935887295 +0100 +diff -Naur coreutils-8.23.orig/src/cut.c coreutils-8.23/src/cut.c +--- coreutils-8.23.orig/src/cut.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/cut.c 2014-07-18 22:44:56.489482312 -0500 @@ -28,6 +28,11 @@ #include #include @@ -75,7 +95,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + while (0) + +/* Get wide character on BUFPOS. BUFPOS is not included after that. -+ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ ++ If byte sequence is not valid as a character, CONVFAIL is true. Otherwise false. */ +#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \ + do \ + { \ @@ -88,7 +108,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + } \ + \ + /* Get a wide character. */ \ -+ CONVFAIL = 0; \ ++ CONVFAIL = false; \ + state_bak = STATE; \ + MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \ + \ @@ -96,7 +116,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + { \ + case (size_t)-1: \ + case (size_t)-2: \ -+ CONVFAIL++; \ ++ CONVFAIL = true; \ + STATE = state_bak; \ + /* Fall througn. */ \ + \ @@ -110,7 +130,16 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c struct range_pair { -@@ -106,15 +169,25 @@ enum operating_mode +@@ -75,6 +138,8 @@ + /* Number of `struct range_pair's allocated. */ + static size_t n_rp_allocated; + ++/* Length of the delimiter given as argument to -d. */ ++size_t delimlen; + + /* Append LOW, HIGH to the list RP of range pairs, allocating additional + space if necessary. Update global variable N_RP. When allocating, +@@ -106,15 +171,25 @@ { undefined_mode, @@ -121,7 +150,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + /* Output characters that are at the given positions. */ + character_mode, + - /* Output the given delimeter-separated fields. */ + /* Output the given delimiter-separated fields. */ field_mode }; @@ -134,12 +163,12 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + if this program runs on multibyte locale. */ +static int force_singlebyte_mode; + - /* If true do not output lines containing no delimeter characters. + /* If true do not output lines containing no delimiter characters. Otherwise, all such lines are printed. This option is valid only with field mode. */ -@@ -126,6 +199,9 @@ static bool complement; +@@ -126,6 +201,9 @@ - /* The delimeter character for field mode. */ + /* The delimiter character for field mode. */ static unsigned char delim; +#if HAVE_WCHAR_H +static wchar_t wcdelim; @@ -147,7 +176,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c /* True if the --output-delimiter=STRING option was specified. */ static bool output_delimiter_specified; -@@ -188,7 +264,7 @@ Print selected parts of lines from each +@@ -188,7 +266,7 @@ -f, --fields=LIST select only these fields; also print any line\n\ that contains no delimiter character, unless\n\ the -s option is specified\n\ @@ -156,7 +185,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c "), stdout); fputs (_("\ --complement complement the set of selected bytes, characters\n\ -@@ -381,6 +457,9 @@ set_fields (const char *fieldstr) +@@ -381,6 +459,9 @@ if (operating_mode == byte_mode) error (0, 0, _("byte offset %s is too large"), quote (bad_num)); @@ -166,7 +195,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c else error (0, 0, _("field number %s is too large"), quote (bad_num)); -@@ -505,6 +584,79 @@ cut_bytes (FILE *stream) +@@ -505,6 +586,82 @@ } } @@ -190,7 +219,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + size_t mblength; /* The byte size of a multibyte character which shows + as same character as WC. */ + mbstate_t state; /* State of the stream. */ -+ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */ ++ bool convfail = false; /* true, when conversion failed. Otherwise false. */ + /* Whether to begin printing delimiters between ranges for the current line. + Set after we've begun printing data corresponding to the first range. */ + bool print_delimiter = false; @@ -207,6 +236,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + REFILL_BUFFER (buf, bufpos, buflen, stream); + + GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail); ++ (void) convfail; /* ignore unused */ + + if (wc == WEOF) + { @@ -229,10 +259,12 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + if (output_delimiter_specified) + { + if (print_delimiter && is_range_start_index (idx)) -+ fwrite (output_delimiter_string, sizeof (char), -+ output_delimiter_length, stdout); ++ { ++ fwrite (output_delimiter_string, sizeof (char), ++ output_delimiter_length, stdout); ++ } ++ print_delimiter = true; + } -+ print_delimiter = true; + fwrite (bufpos, mblength, sizeof(char), stdout); + } + } @@ -246,7 +278,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c /* Read from stream STREAM, printing to standard output any selected fields. */ static void -@@ -629,13 +782,198 @@ cut_fields (FILE *stream) +@@ -649,13 +806,211 @@ } } @@ -266,7 +298,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + size_t mblength; /* The byte size of a multibyte character which shows + as same character as WC. */ + mbstate_t state; /* State of the stream. */ -+ int convfail = 0; /* 1, when conversion is failed. Otherwise 0. */ ++ bool convfail = false; /* true, when conversion failed. Otherwise false. */ + + current_rp = rp; + @@ -348,7 +380,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + fwrite (field_1_buffer, sizeof (char), len - 1, stdout); + found_any_selected_field = 1; + } -+ next_item (&field_idx); ++ next_item (&field_idx); + } + + if (wc != WEOF) @@ -391,7 +423,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + wc = WEOF; + + if (!convfail && wc == wcdelim) -+ next_item (&field_idx); ++ next_item (&field_idx); + else if (wc == WEOF || (!convfail && wc == L'\n')) + { + if (found_any_selected_field @@ -429,6 +461,19 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + break; + + case field_mode: ++ if (delimlen == 1) ++ { ++ /* Check if we have utf8 multibyte locale, so we can use this ++ optimization because of uniqueness of characters, which is ++ not true for e.g. SJIS */ ++ char * loc = setlocale(LC_CTYPE, NULL); ++ if (loc && (strstr (loc, "UTF-8") || strstr (loc, "utf-8") || ++ strstr (loc, "UTF8") || strstr (loc, "utf8"))) ++ { ++ cut_fields (stream); ++ break; ++ } ++ } + cut_fields_mb (stream); + break; + @@ -448,16 +493,15 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c } /* Process file FILE to standard output. -@@ -687,6 +1025,8 @@ main (int argc, char **argv) +@@ -707,6 +1062,7 @@ bool ok; bool delim_specified = false; char *spec_list_string IF_LINT ( = NULL); + char mbdelim[MB_LEN_MAX + 1]; -+ size_t delimlen = 0; initialize_main (&argc, &argv); set_program_name (argv[0]); -@@ -709,7 +1049,6 @@ main (int argc, char **argv) +@@ -729,7 +1085,6 @@ switch (optc) { case 'b': @@ -465,7 +509,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c /* Build the byte list. */ if (operating_mode != undefined_mode) FATAL_ERROR (_("only one type of list may be specified")); -@@ -717,6 +1056,14 @@ main (int argc, char **argv) +@@ -737,6 +1092,14 @@ spec_list_string = optarg; break; @@ -480,7 +524,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c case 'f': /* Build the field list. */ if (operating_mode != undefined_mode) -@@ -728,10 +1075,36 @@ main (int argc, char **argv) +@@ -748,10 +1111,38 @@ case 'd': /* New delimiter. */ /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */ @@ -506,6 +550,8 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c + FATAL_ERROR (_("the delimiter must be a single character")); + memcpy (mbdelim, optarg, delimlen); + mbdelim[delimlen] = '\0'; ++ if (delimlen == 1) ++ delim = *optarg; + } + } + @@ -521,7 +567,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c break; case OUTPUT_DELIMITER_OPTION: -@@ -744,6 +1117,7 @@ main (int argc, char **argv) +@@ -764,6 +1155,7 @@ break; case 'n': @@ -529,7 +575,7 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c break; case 's': -@@ -783,15 +1157,34 @@ main (int argc, char **argv) +@@ -803,15 +1195,34 @@ } if (!delim_specified) @@ -570,10 +616,10 @@ diff -urNp coreutils-8.22-orig/src/cut.c coreutils-8.22/src/cut.c } if (optind == argc) -diff -urNp coreutils-8.22-orig/src/expand.c coreutils-8.22/src/expand.c ---- coreutils-8.22-orig/src/expand.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/expand.c 2013-12-16 17:40:25.936886952 +0100 -@@ -37,12 +37,29 @@ +diff -Naur coreutils-8.23.orig/src/expand.c coreutils-8.23/src/expand.c +--- coreutils-8.23.orig/src/expand.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/expand.c 2014-07-18 22:36:17.394067191 -0500 +@@ -37,12 +37,34 @@ #include #include #include @@ -582,6 +628,11 @@ diff -urNp coreutils-8.22-orig/src/expand.c coreutils-8.22/src/expand.c +#if HAVE_WCHAR_H +# include +#endif ++ ++/* Get iswblank(). */ ++#if HAVE_WCTYPE_H ++# include ++#endif + #include "system.h" #include "error.h" @@ -603,7 +654,7 @@ diff -urNp coreutils-8.22-orig/src/expand.c coreutils-8.22/src/expand.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "expand" -@@ -357,6 +374,142 @@ expand (void) +@@ -357,6 +379,142 @@ } } @@ -746,7 +797,7 @@ diff -urNp coreutils-8.22-orig/src/expand.c coreutils-8.22/src/expand.c int main (int argc, char **argv) { -@@ -421,7 +574,12 @@ main (int argc, char **argv) +@@ -421,7 +579,12 @@ file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -760,9 +811,9 @@ diff -urNp coreutils-8.22-orig/src/expand.c coreutils-8.22/src/expand.c if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); -diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c ---- coreutils-8.22-orig/src/fold.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/fold.c 2013-12-16 17:40:25.938886274 +0100 +diff -Naur coreutils-8.23.orig/src/fold.c coreutils-8.23/src/fold.c +--- coreutils-8.23.orig/src/fold.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/fold.c 2014-07-18 22:36:17.394067191 -0500 @@ -22,12 +22,34 @@ #include #include @@ -844,7 +895,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c {"spaces", no_argument, NULL, 's'}, {"width", required_argument, NULL, 'w'}, {GETOPT_HELP_OPTION_DECL}, -@@ -76,6 +119,7 @@ standard output.\n\ +@@ -76,6 +119,7 @@ fputs (_("\ -b, --bytes count bytes rather than columns\n\ @@ -852,7 +903,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c -s, --spaces break at spaces\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\ "), stdout); -@@ -93,7 +137,7 @@ standard output.\n\ +@@ -93,7 +137,7 @@ static size_t adjust_column (size_t column, char c) { @@ -861,7 +912,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c { if (c == '\b') { -@@ -116,30 +160,14 @@ adjust_column (size_t column, char c) +@@ -116,30 +160,14 @@ to stdout, with maximum line length WIDTH. Return true if successful. */ @@ -894,7 +945,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c fadvise (istream, FADVISE_SEQUENTIAL); -@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t +@@ -169,6 +197,15 @@ bool found_blank = false; size_t logical_end = offset_out; @@ -910,16 +961,16 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c /* Look for the last blank. */ while (logical_end) { -@@ -215,11 +252,221 @@ fold_file (char const *filename, size_t +@@ -215,11 +252,221 @@ line_out[offset_out++] = c; } - saved_errno = errno; + *saved_errno = errno; - - if (offset_out) - fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); - ++ ++ if (offset_out) ++ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); ++ +} + +#if HAVE_MBRTOWC @@ -1091,10 +1142,10 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c + } + + *saved_errno = errno; -+ -+ if (offset_out) -+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); -+ + + if (offset_out) + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); + +} +#endif + @@ -1103,7 +1154,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c + Return 0 if successful, 1 if an error occurs. */ + +static bool -+fold_file (char *filename, size_t width) ++fold_file (char const *filename, size_t width) +{ + FILE *istream; + int saved_errno; @@ -1133,7 +1184,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c if (ferror (istream)) { error (0, saved_errno, "%s", filename); -@@ -252,7 +499,8 @@ main (int argc, char **argv) +@@ -252,7 +499,8 @@ atexit (close_stdout); @@ -1143,7 +1194,7 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) { -@@ -261,7 +509,15 @@ main (int argc, char **argv) +@@ -261,7 +509,15 @@ switch (optc) { case 'b': /* Count bytes rather than columns. */ @@ -1160,9 +1211,9 @@ diff -urNp coreutils-8.22-orig/src/fold.c coreutils-8.22/src/fold.c break; case 's': /* Break at word boundaries. */ -diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c ---- coreutils-8.22-orig/src/join.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/join.c 2013-12-16 17:40:25.940885607 +0100 +diff -Naur coreutils-8.23.orig/src/join.c coreutils-8.23/src/join.c +--- coreutils-8.23.orig/src/join.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/join.c 2014-07-18 22:36:17.394067191 -0500 @@ -22,18 +22,32 @@ #include #include @@ -1197,7 +1248,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "join" -@@ -135,10 +149,12 @@ static struct outlist outlist_head; +@@ -135,10 +149,12 @@ /* Last element in 'outlist', where a new element can be added. */ static struct outlist *outlist_end = &outlist_head; @@ -1214,7 +1265,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c /* If nonzero, check that the input is correctly ordered. */ static enum -@@ -269,13 +285,14 @@ xfields (struct line *line) +@@ -269,13 +285,14 @@ if (ptr == lim) return; @@ -1232,7 +1283,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c { /* Skip leading blanks before the first field. */ while (isblank (to_uchar (*ptr))) -@@ -299,6 +316,148 @@ xfields (struct line *line) +@@ -299,6 +316,147 @@ extract_field (line, ptr, lim - ptr); } @@ -1253,7 +1304,6 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c + + if (tab != NULL) + { -+ unsigned char t = tab[0]; + char *sep = ptr; + for (; ptr < lim; ptr = sep + mblength) + { @@ -1381,7 +1431,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c static void freeline (struct line *line) { -@@ -320,56 +479,130 @@ keycmp (struct line const *line1, struct +@@ -320,56 +478,133 @@ size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -1453,6 +1503,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c + { + mallocd = 1; + copy[i] = xmalloc (len[i] + 1); ++ memset (copy[i], '\0',len[i] + 1); + + for (j = 0; j < MIN (len[0], len[1]);) + { @@ -1475,9 +1526,11 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c + if (uwc != wc) + { + mbstate_t state_wc; ++ size_t mblen; + + memset (&state_wc, '\0', sizeof (mbstate_t)); -+ wcrtomb (copy[i] + j, uwc, &state_wc); ++ mblen = wcrtomb (copy[i] + j, uwc, &state_wc); ++ assert (mblen != (size_t)-1); + } + else + memcpy (copy[i] + j, beg[i] + j, mblength); @@ -1507,10 +1560,10 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c - if (hard_LC_COLLATE) - return xmemcoll (beg1, len1, beg2, len2); - diff = memcmp (beg1, beg2, MIN (len1, len2)); -+ copy[0] = (unsigned char *) beg[0]; -+ copy[1] = (unsigned char *) beg[1]; - } - ++ copy[0] = beg[0]; ++ copy[1] = beg[1]; ++ } ++ + if (hard_LC_COLLATE) + { + diff = xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]); @@ -1520,14 +1573,14 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c + free (copy[i]); + + return diff; -+ } + } + diff = memcmp (copy[0], copy[1], MIN (len[0], len[1])); + + if (mallocd) + for (i = 0; i < 2; i++) + free (copy[i]); + -+ + if (diff) return diff; - return len1 < len2 ? -1 : len1 != len2; @@ -1535,7 +1588,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c } /* Check that successive input lines PREV and CURRENT from input file -@@ -461,6 +694,11 @@ get_line (FILE *fp, struct line **linep, +@@ -461,6 +696,11 @@ } ++line_no[which - 1]; @@ -1547,7 +1600,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c xfields (line); if (prevline[which - 1]) -@@ -560,21 +798,28 @@ prfield (size_t n, struct line const *li +@@ -560,21 +800,28 @@ /* Output all the fields in line, other than the join field. */ @@ -1579,7 +1632,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c prfield (i, line); } } -@@ -585,7 +830,6 @@ static void +@@ -585,7 +832,6 @@ prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; @@ -1587,7 +1640,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c size_t field; struct line const *line; -@@ -619,7 +863,7 @@ prjoin (struct line const *line1, struct +@@ -619,7 +865,7 @@ o = o->next; if (o == NULL) break; @@ -1596,7 +1649,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c } putchar (eolchar); } -@@ -1097,21 +1341,46 @@ main (int argc, char **argv) +@@ -1097,21 +1343,46 @@ case 't': { @@ -1624,7 +1677,7 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c if (! newtab) - newtab = '\n'; /* '' => process the whole line. */ + { -+ newtab = "\n"; /* '' => process the whole line. */ ++ newtab = (char*)"\n"; /* '' => process the whole line. */ + } else if (optarg[1]) { @@ -1653,10 +1706,10 @@ diff -urNp coreutils-8.22-orig/src/join.c coreutils-8.22/src/join.c break; case 'z': -diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c ---- coreutils-8.22-orig/src/pr.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/pr.c 2013-12-16 17:40:25.944884263 +0100 -@@ -312,6 +312,32 @@ +diff -Naur coreutils-8.23.orig/src/pr.c coreutils-8.23/src/pr.c +--- coreutils-8.23.orig/src/pr.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/pr.c 2014-07-18 22:36:17.395067159 -0500 +@@ -312,6 +312,24 @@ #include #include @@ -1677,19 +1730,11 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c +#if HAVE_WCHAR_H +# include +#endif -+ -+/* Get iswprint(). -- for wcwidth(). */ -+#if HAVE_WCTYPE_H -+# include -+#endif -+#if !defined iswprint && !HAVE_ISWPRINT -+# define iswprint(wc) 1 -+#endif + #include "system.h" #include "error.h" #include "fadvise.h" -@@ -323,6 +349,18 @@ +@@ -323,6 +341,18 @@ #include "strftime.h" #include "xstrtol.h" @@ -1708,7 +1753,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "pr" -@@ -415,7 +453,20 @@ struct COLUMN +@@ -415,7 +445,20 @@ typedef struct COLUMN COLUMN; @@ -1730,7 +1775,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c static bool read_line (COLUMN *p); static bool print_page (void); static bool print_stored (COLUMN *p); -@@ -425,6 +476,7 @@ static void print_header (void); +@@ -425,6 +468,7 @@ static void pad_across_to (int position); static void add_line_number (COLUMN *p); static void getoptarg (char *arg, char switch_char, char *character, @@ -1738,7 +1783,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c int *number); static void print_files (int number_of_files, char **av); static void init_parameters (int number_of_files); -@@ -438,7 +490,6 @@ static void store_char (char c); +@@ -438,7 +482,6 @@ static void pad_down (int lines); static void read_rest_of_line (COLUMN *p); static void skip_read (COLUMN *p, int column_number); @@ -1746,7 +1791,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c static void cleanup (void); static void print_sep_string (void); static void separator_string (const char *optarg_S); -@@ -450,7 +501,7 @@ static COLUMN *column_vector; +@@ -450,7 +493,7 @@ we store the leftmost columns contiguously in buff. To print a line from buff, get the index of the first character from line_vector[i], and print up to line_vector[i + 1]. */ @@ -1755,7 +1800,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* Index of the position in buff where the next character will be stored. */ -@@ -554,7 +605,7 @@ static int chars_per_column; +@@ -554,7 +597,7 @@ static bool untabify_input = false; /* (-e) The input tab character. */ @@ -1764,7 +1809,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... where the leftmost column is 1. */ -@@ -564,7 +615,10 @@ static int chars_per_input_tab = 8; +@@ -564,7 +607,10 @@ static bool tabify_output = false; /* (-i) The output tab character. */ @@ -1776,7 +1821,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* (-i) The width of the output tab. */ static int chars_per_output_tab = 8; -@@ -634,7 +688,13 @@ static int line_number; +@@ -634,7 +680,13 @@ static bool numbered_lines = false; /* (-n) Character which follows each line number. */ @@ -1791,7 +1836,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* (-n) line counting starts with 1st line of input file (not with 1st line of 1st page printed). */ -@@ -687,6 +747,7 @@ static bool use_col_separator = false; +@@ -687,6 +739,7 @@ -a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */ static char *col_sep_string = (char *) ""; static int col_sep_length = 0; @@ -1799,7 +1844,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c static char *column_separator = (char *) " "; static char *line_separator = (char *) "\t"; -@@ -843,6 +904,13 @@ separator_string (const char *optarg_S) +@@ -843,6 +896,13 @@ col_sep_length = (int) strlen (optarg_S); col_sep_string = xmalloc (col_sep_length + 1); strcpy (col_sep_string, optarg_S); @@ -1813,7 +1858,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c } int -@@ -867,6 +935,21 @@ main (int argc, char **argv) +@@ -867,6 +927,21 @@ atexit (close_stdout); @@ -1835,7 +1880,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c n_files = 0; file_names = (argc > 1 ? xmalloc ((argc - 1) * sizeof (char *)) -@@ -943,8 +1026,12 @@ main (int argc, char **argv) +@@ -943,8 +1018,12 @@ break; case 'e': if (optarg) @@ -1850,7 +1895,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* Could check tab width > 0. */ untabify_input = true; break; -@@ -957,8 +1044,12 @@ main (int argc, char **argv) +@@ -957,8 +1036,12 @@ break; case 'i': if (optarg) @@ -1865,7 +1910,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* Could check tab width > 0. */ tabify_output = true; break; -@@ -985,8 +1076,8 @@ main (int argc, char **argv) +@@ -985,8 +1068,8 @@ case 'n': numbered_lines = true; if (optarg) @@ -1876,7 +1921,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c break; case 'N': skip_count = false; -@@ -1025,7 +1116,7 @@ main (int argc, char **argv) +@@ -1025,7 +1108,7 @@ old_s = false; /* Reset an additional input of -s, -S dominates -s */ col_sep_string = bad_cast (""); @@ -1885,7 +1930,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c use_col_separator = true; if (optarg) separator_string (optarg); -@@ -1182,10 +1273,45 @@ main (int argc, char **argv) +@@ -1182,10 +1265,45 @@ a number. */ static void @@ -1933,7 +1978,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c if (*arg) { long int tmp_long; -@@ -1207,6 +1333,11 @@ static void +@@ -1207,6 +1325,11 @@ init_parameters (int number_of_files) { int chars_used_by_number = 0; @@ -1945,7 +1990,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c lines_per_body = lines_per_page - lines_per_header - lines_per_footer; if (lines_per_body <= 0) -@@ -1244,7 +1375,7 @@ init_parameters (int number_of_files) +@@ -1244,7 +1367,7 @@ else col_sep_string = column_separator; @@ -1954,7 +1999,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c use_col_separator = true; } /* It's rather pointless to define a TAB separator with column -@@ -1274,11 +1405,11 @@ init_parameters (int number_of_files) +@@ -1274,11 +1397,11 @@ + TAB_WIDTH (chars_per_input_tab, chars_per_number); */ /* Estimate chars_per_text without any margin and keep it constant. */ @@ -1968,7 +2013,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* The number is part of the column width unless we are printing files in parallel. */ -@@ -1287,7 +1418,7 @@ init_parameters (int number_of_files) +@@ -1287,7 +1410,7 @@ } chars_per_column = (chars_per_line - chars_used_by_number @@ -1977,7 +2022,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c if (chars_per_column < 1) error (EXIT_FAILURE, 0, _("page width too narrow")); -@@ -1305,7 +1436,7 @@ init_parameters (int number_of_files) +@@ -1305,7 +1428,7 @@ We've to use 8 as the lower limit, if we use chars_per_default_tab = 8 to expand a tab which is not an input_tab-char. */ free (clump_buff); @@ -1986,7 +2031,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c } /* Open the necessary files, -@@ -1413,7 +1544,7 @@ init_funcs (void) +@@ -1413,7 +1536,7 @@ /* Enlarge p->start_position of first column to use the same form of padding_not_printed with all columns. */ @@ -1995,7 +2040,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* This loop takes care of all but the rightmost column. */ -@@ -1447,7 +1578,7 @@ init_funcs (void) +@@ -1447,7 +1570,7 @@ } else { @@ -2004,7 +2049,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c h_next = h + chars_per_column; } } -@@ -1738,9 +1869,9 @@ static void +@@ -1738,9 +1861,9 @@ align_column (COLUMN *p) { padding_not_printed = p->start_position; @@ -2016,7 +2061,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c padding_not_printed = ANYWHERE; } -@@ -2011,13 +2142,13 @@ store_char (char c) +@@ -2011,13 +2134,13 @@ /* May be too generous. */ buff = X2REALLOC (buff, &buff_allocated); } @@ -2032,7 +2077,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c char *s; int num_width; -@@ -2034,22 +2165,24 @@ add_line_number (COLUMN *p) +@@ -2034,22 +2157,24 @@ /* Tabification is assumed for multiple columns, also for n-separators, but 'default n-separator = TAB' hasn't been given priority over equal column_width also specified by POSIX. */ @@ -2061,7 +2106,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c output_position = POS_AFTER_TAB (chars_per_output_tab, output_position); } -@@ -2210,7 +2343,7 @@ print_white_space (void) +@@ -2210,7 +2335,7 @@ while (goal - h_old > 1 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) { @@ -2070,7 +2115,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c h_old = h_new; } while (++h_old <= goal) -@@ -2230,6 +2363,7 @@ print_sep_string (void) +@@ -2230,6 +2355,7 @@ { char *s; int l = col_sep_length; @@ -2078,7 +2123,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c s = col_sep_string; -@@ -2243,6 +2377,7 @@ print_sep_string (void) +@@ -2243,6 +2369,7 @@ { for (; separators_not_printed > 0; --separators_not_printed) { @@ -2086,7 +2131,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c while (l-- > 0) { /* 3 types of sep_strings: spaces only, spaces and chars, -@@ -2256,12 +2391,15 @@ print_sep_string (void) +@@ -2256,12 +2383,15 @@ } else { @@ -2103,7 +2148,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* sep_string ends with some spaces */ if (spaces_not_printed > 0) print_white_space (); -@@ -2289,7 +2427,7 @@ print_clump (COLUMN *p, int n, char *clu +@@ -2289,7 +2419,7 @@ required number of tabs and spaces. */ static void @@ -2112,7 +2157,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c { if (tabify_output) { -@@ -2313,6 +2451,74 @@ print_char (char c) +@@ -2313,6 +2443,74 @@ putchar (c); } @@ -2187,7 +2232,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* Skip to page PAGE before printing. PAGE may be larger than total number of pages. */ -@@ -2492,9 +2698,9 @@ read_line (COLUMN *p) +@@ -2492,9 +2690,9 @@ align_empty_cols = false; } @@ -2199,7 +2244,25 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c padding_not_printed = ANYWHERE; } -@@ -2595,9 +2801,9 @@ print_stored (COLUMN *p) +@@ -2564,7 +2762,7 @@ + int i; + + int line = p->current_line++; +- char *first = &buff[line_vector[line]]; ++ unsigned char *first = &buff[line_vector[line]]; + /* FIXME + UMR: Uninitialized memory read: + * This is occurring while in: +@@ -2576,7 +2774,7 @@ + xmalloc [xmalloc.c:94] + init_store_cols [pr.c:1648] + */ +- char *last = &buff[line_vector[line + 1]]; ++ unsigned char *last = &buff[line_vector[line + 1]]; + + pad_vertically = true; + +@@ -2595,9 +2793,9 @@ } } @@ -2211,7 +2274,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c padding_not_printed = ANYWHERE; } -@@ -2610,8 +2816,8 @@ print_stored (COLUMN *p) +@@ -2610,8 +2808,8 @@ if (spaces_not_printed == 0) { output_position = p->start_position + end_vector[line]; @@ -2222,7 +2285,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c } return true; -@@ -2630,7 +2836,7 @@ print_stored (COLUMN *p) +@@ -2630,7 +2828,7 @@ number of characters is 1.) */ static int @@ -2231,7 +2294,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c { unsigned char uc = c; char *s = clump_buff; -@@ -2640,10 +2846,10 @@ char_to_clump (char c) +@@ -2640,10 +2838,10 @@ int chars; int chars_per_c = 8; @@ -2244,7 +2307,7 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c { width = TAB_WIDTH (chars_per_c, input_position); -@@ -2724,6 +2930,164 @@ char_to_clump (char c) +@@ -2724,6 +2922,164 @@ return chars; } @@ -2409,9 +2472,9 @@ diff -urNp coreutils-8.22-orig/src/pr.c coreutils-8.22/src/pr.c /* We've just printed some files and need to clean up things before looking for more options and printing the next batch of files. -diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c ---- coreutils-8.22-orig/src/sort.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/sort.c 2013-12-16 17:40:25.949882582 +0100 +diff -Naur coreutils-8.23.orig/src/sort.c coreutils-8.23/src/sort.c +--- coreutils-8.23.orig/src/sort.c 2014-07-13 17:09:52.000000000 -0500 ++++ coreutils-8.23/src/sort.c 2014-07-18 22:36:17.397067101 -0500 @@ -29,6 +29,14 @@ #include #include @@ -2427,8 +2490,13 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c #include "system.h" #include "argmatch.h" #include "error.h" -@@ -166,12 +174,34 @@ static int thousands_sep; +@@ -164,14 +172,39 @@ + /* Thousands separator; if -1, then there isn't one. */ + static int thousands_sep; ++/* True if -f is specified. */ ++static bool folding; ++ /* Nonzero if the corresponding locales are hard. */ static bool hard_LC_COLLATE; -#if HAVE_NL_LANGINFO @@ -2463,7 +2531,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both }; -@@ -345,13 +375,11 @@ static bool reverse; +@@ -345,13 +378,11 @@ they were read if all keys compare equal. */ static bool stable; @@ -2480,7 +2548,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -811,6 +839,46 @@ reap_all (void) +@@ -811,6 +842,46 @@ reap (-1); } @@ -2527,7 +2595,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Clean up any remaining temporary files. */ static void -@@ -1255,7 +1323,7 @@ zaptemp (char const *name) +@@ -1255,7 +1326,7 @@ free (node); } @@ -2536,7 +2604,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c static int struct_month_cmp (void const *m1, void const *m2) -@@ -1270,7 +1338,7 @@ struct_month_cmp (void const *m1, void c +@@ -1270,7 +1341,7 @@ /* Initialize the character class tables. */ static void @@ -2545,7 +2613,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { size_t i; -@@ -1282,7 +1350,7 @@ inittables (void) +@@ -1282,7 +1353,7 @@ fold_toupper[i] = toupper (i); } @@ -2554,7 +2622,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1364,6 +1432,84 @@ specify_nmerge (int oi, char c, char con +@@ -1364,6 +1435,84 @@ xstrtol_fatal (e, oi, c, long_options, s); } @@ -2639,7 +2707,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Specify the amount of main memory to use when sorting. */ static void specify_sort_size (int oi, char c, char const *s) -@@ -1597,7 +1743,7 @@ buffer_linelim (struct buffer const *buf +@@ -1597,7 +1746,7 @@ by KEY in LINE. */ static char * @@ -2648,7 +2716,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1606,10 +1752,10 @@ begfield (struct line const *line, struc +@@ -1606,10 +1755,10 @@ /* The leading field separator itself is included in a field when -t is absent. */ @@ -2661,7 +2729,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c ++ptr; if (ptr < lim) ++ptr; -@@ -1635,11 +1781,70 @@ begfield (struct line const *line, struc +@@ -1635,11 +1784,70 @@ return ptr; } @@ -2733,7 +2801,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1654,10 +1859,10 @@ limfield (struct line const *line, struc +@@ -1654,10 +1862,10 @@ 'beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first 'blank' character after the preceding field. */ @@ -2746,7 +2814,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1703,10 +1908,10 @@ limfield (struct line const *line, struc +@@ -1703,10 +1911,10 @@ */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -2759,7 +2827,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c if (newlim) lim = newlim; } -@@ -1737,6 +1942,130 @@ limfield (struct line const *line, struc +@@ -1737,6 +1945,130 @@ return ptr; } @@ -2890,7 +2958,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Fill BUF reading from FP, moving buf->left bytes from the end of buf->buf to the beginning first. If EOF is reached and the file wasn't terminated by a newline, supply one. Set up BUF's line -@@ -1823,8 +2152,22 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1823,8 +2155,22 @@ else { if (key->skipsblanks) @@ -2915,7 +2983,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c line->keybeg = line_start; } } -@@ -1945,7 +2288,7 @@ human_numcompare (char const *a, char co +@@ -1945,7 +2291,7 @@ hideously fast. */ static int @@ -2924,7 +2992,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { while (blanks[to_uchar (*a)]) a++; -@@ -1955,6 +2298,25 @@ numcompare (char const *a, char const *b +@@ -1955,6 +2301,25 @@ return strnumcmp (a, b, decimal_point, thousands_sep); } @@ -2950,7 +3018,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Work around a problem whereby the long double value returned by glibc's strtold ("NaN", ...) contains uninitialized bits: clear all bytes of A and B before calling strtold. FIXME: remove this function once -@@ -2005,7 +2367,7 @@ general_numcompare (char const *sa, char +@@ -2005,7 +2370,7 @@ Return 0 if the name in S is not recognized. */ static int @@ -2959,7 +3027,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -2280,15 +2642,14 @@ debug_key (struct line const *line, stru +@@ -2280,15 +2645,14 @@ char saved = *lim; *lim = '\0'; @@ -2977,7 +3045,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c else if (key->general_numeric) ignore_value (strtold (beg, &tighter_lim)); else if (key->numeric || key->human_numeric) -@@ -2432,7 +2793,7 @@ key_warnings (struct keyfield const *gke +@@ -2432,7 +2796,7 @@ bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) && !(key->schar || key->echar); bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ @@ -2986,7 +3054,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned)) || (!key->skipsblanks && key->schar) || (!key->skipeblanks && key->echar))) -@@ -2490,11 +2851,87 @@ key_warnings (struct keyfield const *gke +@@ -2490,11 +2854,87 @@ error (0, 0, _("option '-r' only applies to last-resort comparison")); } @@ -3056,7 +3124,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c + ? monthtab[lo].val : 0); + + if (ea && result) -+ *ea = s + strlen (monthtab[lo].name); ++ *ea = (char*) s + strlen (monthtab[lo].name); + + free (month); + free (tmp); @@ -3075,7 +3143,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c { struct keyfield *key = keylist; -@@ -2579,7 +3016,7 @@ keycompare (struct line const *a, struct +@@ -2579,7 +3019,7 @@ else if (key->human_numeric) diff = human_numcompare (ta, tb); else if (key->month) @@ -3084,7 +3152,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2695,6 +3132,191 @@ keycompare (struct line const *a, struct +@@ -2695,6 +3135,191 @@ return key->reverse ? -diff : diff; } @@ -3227,12 +3295,12 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c + diff = - NONZERO (lenb); + else if (lenb == 0) + diff = 1; ++ else if (hard_LC_COLLATE && !folding) ++ { ++ diff = xmemcoll0 (texta, lena, textb, lenb); ++ } + else -+ { -+ diff = memcmp (texta, textb, MIN (lena,lenb)); -+ if (!diff) -+ diff = xmemcoll (texta, lena, textb, lenb); -+ } ++ diff = memcmp (texta, textb, MIN (lena + 1,lenb + 1)); + + if (ignore || translate) + free (texta); @@ -3276,22 +3344,24 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -2722,14 +3344,6 @@ compare (struct line const *a, struct li +@@ -2722,7 +3347,7 @@ diff = - NONZERO (blen); else if (blen == 0) diff = 1; - else if (hard_LC_COLLATE) -- { -- /* Note xmemcoll0 is a performance enhancement as -- it will not unconditionally write '\0' after the -- passed in buffers, which was seen to give around -- a 3% increase in performance for short lines. */ -- diff = xmemcoll0 (a->text, alen + 1, b->text, blen + 1); -- } - else if (! (diff = memcmp (a->text, b->text, MIN (alen, blen)))) - diff = alen < blen ? -1 : alen != blen; - -@@ -4190,7 +4804,7 @@ main (int argc, char **argv) ++ else if (hard_LC_COLLATE && !folding) + { + /* Note xmemcoll0 is a performance enhancement as + it will not unconditionally write '\0' after the +@@ -4121,6 +4746,7 @@ + break; + case 'f': + key->translate = fold_toupper; ++ folding = true; + break; + case 'g': + key->general_numeric = true; +@@ -4198,7 +4824,7 @@ initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3300,7 +3370,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4211,6 +4825,29 @@ main (int argc, char **argv) +@@ -4219,6 +4845,29 @@ thousands_sep = -1; } @@ -3330,7 +3400,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c have_read_stdin = false; inittables (); -@@ -4485,13 +5122,34 @@ main (int argc, char **argv) +@@ -4493,13 +5142,34 @@ case 't': { @@ -3369,7 +3439,7 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c else { /* Provoke with 'sort -txx'. Complain about -@@ -4502,9 +5160,12 @@ main (int argc, char **argv) +@@ -4510,9 +5180,12 @@ quote (optarg)); } } @@ -3384,9 +3454,9 @@ diff -urNp coreutils-8.22-orig/src/sort.c coreutils-8.22/src/sort.c } break; -diff -urNp coreutils-8.22-orig/src/unexpand.c coreutils-8.22/src/unexpand.c ---- coreutils-8.22-orig/src/unexpand.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/unexpand.c 2013-12-16 17:40:25.951881910 +0100 +diff -Naur coreutils-8.23.orig/src/unexpand.c coreutils-8.23/src/unexpand.c +--- coreutils-8.23.orig/src/unexpand.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/unexpand.c 2014-07-18 22:36:17.397067101 -0500 @@ -38,12 +38,29 @@ #include #include @@ -3417,7 +3487,7 @@ diff -urNp coreutils-8.22-orig/src/unexpand.c coreutils-8.22/src/unexpand.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "unexpand" -@@ -103,6 +120,210 @@ static struct option const longopts[] = +@@ -103,6 +120,210 @@ {NULL, 0, NULL, 0} }; @@ -3628,7 +3698,7 @@ diff -urNp coreutils-8.22-orig/src/unexpand.c coreutils-8.22/src/unexpand.c void usage (int status) { -@@ -523,7 +744,12 @@ main (int argc, char **argv) +@@ -523,7 +744,12 @@ file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -3642,10 +3712,10 @@ diff -urNp coreutils-8.22-orig/src/unexpand.c coreutils-8.22/src/unexpand.c if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); -diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c ---- coreutils-8.22-orig/src/uniq.c 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/src/uniq.c 2013-12-16 17:41:06.711697074 +0100 -@@ -21,6 +21,16 @@ +diff -Naur coreutils-8.23.orig/src/uniq.c coreutils-8.23/src/uniq.c +--- coreutils-8.23.orig/src/uniq.c 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/src/uniq.c 2014-07-18 22:36:17.398067074 -0500 +@@ -21,6 +21,17 @@ #include #include @@ -3658,11 +3728,12 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c +#if HAVE_WCTYPE_H +# include +#endif ++#include + #include "system.h" #include "argmatch.h" #include "linebuffer.h" -@@ -32,7 +42,19 @@ +@@ -32,7 +43,19 @@ #include "stdio--.h" #include "xmemcoll.h" #include "xstrtol.h" @@ -3683,7 +3754,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "uniq" -@@ -143,6 +165,10 @@ enum +@@ -143,6 +166,10 @@ GROUP_OPTION = CHAR_MAX + 1 }; @@ -3694,7 +3765,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c static struct option const longopts[] = { {"count", no_argument, NULL, 'c'}, -@@ -249,7 +275,7 @@ size_opt (char const *opt, char const *m +@@ -251,7 +278,7 @@ return a pointer to the beginning of the line's field to be compared. */ static char * _GL_ATTRIBUTE_PURE @@ -3703,7 +3774,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c { size_t count; char const *lp = line->buffer; -@@ -269,6 +295,83 @@ find_field (struct linebuffer const *lin +@@ -271,6 +298,83 @@ return line->buffer + i; } @@ -3787,7 +3858,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c /* Return false if two strings OLD and NEW match, true if not. OLD and NEW point not to the beginnings of the lines but rather to the beginnings of the fields to compare. -@@ -277,6 +380,8 @@ find_field (struct linebuffer const *lin +@@ -279,6 +383,8 @@ static bool different (char *old, char *new, size_t oldlen, size_t newlen) { @@ -3796,7 +3867,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c if (check_chars < oldlen) oldlen = check_chars; if (check_chars < newlen) -@@ -284,14 +389,100 @@ different (char *old, char *new, size_t +@@ -286,15 +392,104 @@ if (ignore_case) { @@ -3828,8 +3899,8 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c + + return xmemcoll (copy_old, oldlen, copy_new, newlen); + -+} -+ + } + +#if HAVE_MBRTOWC +static int +different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate) @@ -3853,6 +3924,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c + for (i = 0; i < 2; i++) + { + copy[i] = xmalloc (len[i] + 1); ++ memset (copy[i], '\0', len[i] + 1); + + for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++) + { @@ -3877,9 +3949,11 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c + if (uwc != wc) + { + mbstate_t state_wc; ++ size_t mblen; + + memset (&state_wc, '\0', sizeof(mbstate_t)); -+ wcrtomb (copy[i] + j, uwc, &state_wc); ++ mblen = wcrtomb (copy[i] + j, uwc, &state_wc); ++ assert (mblen != (size_t)-1); + } + else + memcpy (copy[i] + j, str[i] + j, mblength); @@ -3897,12 +3971,13 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c + free (copy[1]); + return rc; + - } ++} +#endif - ++ /* Output the line in linebuffer LINE to standard output provided that the switches say it should be output. -@@ -356,18 +547,55 @@ check_file (const char *infile, const ch + MATCH is true if the line matches the previous line. +@@ -358,19 +553,38 @@ char *prevfield IF_LINT ( = NULL); size_t prevlen IF_LINT ( = 0); bool first_group_printed = false; @@ -3927,57 +4002,32 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); +#if HAVE_MBRTOWC -+ if (MB_CUR_MAX > 1) ++ if (MB_CUR_MAX > 1) + { -+ thisstate = thisline->state; -+ -+ new_group = (prevline->length == 0 || different_multi -+ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate)); -+ -+ if (new_group && grouping != GM_NONE -+ && (grouping == GM_PREPEND || grouping == GM_BOTH -+ || (first_group_printed && (grouping == GM_APPEND -+ || grouping == GM_SEPARATE)))) -+ putchar (delimiter); -+ -+ if (new_group || grouping != GM_NONE) -+ { -+ fwrite (thisline->buffer, sizeof (char), -+ thisline->length, stdout); -+ -+ SWAP_LINES (prevline, thisline); -+ prevfield = thisfield; -+ prevlen = thislen; -+ prevstate = thisstate; -+ first_group_printed = true; -+ } -+ } -+ else -+ { -+#endif ++ thisstate = thisline->state; ++ new_group = (prevline->length == 0 ++ || different_multi (thisfield, prevfield, ++ thislen, prevlen, ++ thisstate, prevstate)); ++ } ++ else ++#endif new_group = (prevline->length == 0 || different (thisfield, prevfield, thislen, prevlen)); -@@ -376,7 +604,7 @@ check_file (const char *infile, const ch - && (grouping == GM_PREPEND || grouping == GM_BOTH - || (first_group_printed && (grouping == GM_APPEND - || grouping == GM_SEPARATE)))) -- putchar (delimiter); -+ putchar (delimiter); - if (new_group || grouping != GM_NONE) - { -@@ -388,6 +616,9 @@ check_file (const char *infile, const ch +@@ -388,6 +602,10 @@ + SWAP_LINES (prevline, thisline); + prevfield = thisfield; prevlen = thislen; ++#if HAVE_MBRTOWC ++ if (MB_CUR_MAX > 1) ++ prevstate = thisstate; ++#endif first_group_printed = true; } -+#if HAVE_MBRTOWC -+ } -+#endif } - if ((grouping == GM_BOTH || grouping == GM_APPEND) && first_group_printed) - putchar (delimiter); -@@ -398,17 +629,26 @@ check_file (const char *infile, const ch +@@ -400,17 +618,26 @@ size_t prevlen; uintmax_t match_count = 0; bool first_delimiter = true; @@ -4004,7 +4054,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) -@@ -417,6 +657,14 @@ check_file (const char *infile, const ch +@@ -419,6 +646,14 @@ } thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -4019,7 +4069,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c match = !different (thisfield, prevfield, thislen, prevlen); match_count += match; -@@ -449,6 +697,9 @@ check_file (const char *infile, const ch +@@ -451,6 +686,9 @@ SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -4029,7 +4079,7 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c if (!match) match_count = 0; } -@@ -495,6 +746,19 @@ main (int argc, char **argv) +@@ -497,6 +735,19 @@ atexit (close_stdout); @@ -4049,10 +4099,10 @@ diff -urNp coreutils-8.22-orig/src/uniq.c coreutils-8.22/src/uniq.c skip_chars = 0; skip_fields = 0; check_chars = SIZE_MAX; -diff -urNp coreutils-8.22-orig/tests/local.mk coreutils-8.22/tests/local.mk ---- coreutils-8.22-orig/tests/local.mk 2013-12-16 17:39:49.187181544 +0100 -+++ coreutils-8.22/tests/local.mk 2013-12-16 17:40:25.955880566 +0100 -@@ -324,6 +324,7 @@ all_tests = \ +diff -Naur coreutils-8.23.orig/tests/local.mk coreutils-8.23/tests/local.mk +--- coreutils-8.23.orig/tests/local.mk 2014-07-13 17:09:52.000000000 -0500 ++++ coreutils-8.23/tests/local.mk 2014-07-18 22:36:17.398067074 -0500 +@@ -331,6 +331,7 @@ tests/misc/sort-discrim.sh \ tests/misc/sort-files0-from.pl \ tests/misc/sort-float.sh \ @@ -4060,10 +4110,10 @@ diff -urNp coreutils-8.22-orig/tests/local.mk coreutils-8.22/tests/local.mk tests/misc/sort-merge.pl \ tests/misc/sort-merge-fdlimit.sh \ tests/misc/sort-month.sh \ -diff -urNp coreutils-8.22-orig/tests/misc/cut.pl coreutils-8.22/tests/misc/cut.pl ---- coreutils-8.22-orig/tests/misc/cut.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/cut.pl 2013-12-16 17:40:25.956880230 +0100 -@@ -23,9 +23,11 @@ use strict; +diff -Naur coreutils-8.23.orig/tests/misc/cut.pl coreutils-8.23/tests/misc/cut.pl +--- coreutils-8.23.orig/tests/misc/cut.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/cut.pl 2014-07-18 22:36:17.398067074 -0500 +@@ -23,9 +23,11 @@ # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -4077,7 +4127,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/cut.pl coreutils-8.22/tests/misc/cut.p my $prog = 'cut'; my $try = "Try '$prog --help' for more information.\n"; -@@ -225,6 +227,7 @@ if ($mb_locale ne 'C') +@@ -227,6 +229,7 @@ my @new_t = @$t; my $test_name = shift @new_t; @@ -4085,10 +4135,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/cut.pl coreutils-8.22/tests/misc/cut.p push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; } push @Tests, @new; -diff -urNp coreutils-8.22-orig/tests/misc/expand.pl coreutils-8.22/tests/misc/expand.pl ---- coreutils-8.22-orig/tests/misc/expand.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/expand.pl 2013-12-16 17:40:25.957879894 +0100 -@@ -23,6 +23,15 @@ use strict; +diff -Naur coreutils-8.23.orig/tests/misc/expand.pl coreutils-8.23/tests/misc/expand.pl +--- coreutils-8.23.orig/tests/misc/expand.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/expand.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -23,6 +23,15 @@ # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -4104,7 +4154,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/expand.pl coreutils-8.22/tests/misc/ex my @Tests = ( ['t1', '--tabs=3', {IN=>"a\tb"}, {OUT=>"a b"}], -@@ -31,6 +40,37 @@ my @Tests = +@@ -31,6 +40,37 @@ ['i2', '--tabs=3 -i', {IN=>" \ta\tb"}, {OUT=>" a\tb"}], ); @@ -4142,10 +4192,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/expand.pl coreutils-8.22/tests/misc/ex my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.22-orig/tests/misc/fold.pl coreutils-8.22/tests/misc/fold.pl ---- coreutils-8.22-orig/tests/misc/fold.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/fold.pl 2013-12-16 17:40:25.958879558 +0100 -@@ -20,9 +20,18 @@ use strict; +diff -Naur coreutils-8.23.orig/tests/misc/fold.pl coreutils-8.23/tests/misc/fold.pl +--- coreutils-8.23.orig/tests/misc/fold.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/fold.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -20,9 +20,18 @@ (my $program_name = $0) =~ s|.*/||; @@ -4164,7 +4214,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/fold.pl coreutils-8.22/tests/misc/fold my @Tests = ( ['s1', '-w2 -s', {IN=>"a\t"}, {OUT=>"a\n\t"}], -@@ -31,9 +40,48 @@ my @Tests = +@@ -31,9 +40,48 @@ ['s4', '-w4 -s', {IN=>"abc ef\n"}, {OUT=>"abc \nef\n"}], ); @@ -4214,10 +4264,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/fold.pl coreutils-8.22/tests/misc/fold -my $prog = 'fold'; my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); exit $fail; -diff -urNp coreutils-8.22-orig/tests/misc/join.pl coreutils-8.22/tests/misc/join.pl ---- coreutils-8.22-orig/tests/misc/join.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/join.pl 2013-12-16 17:40:25.959879222 +0100 -@@ -25,6 +25,15 @@ my $limits = getlimits (); +diff -Naur coreutils-8.23.orig/tests/misc/join.pl coreutils-8.23/tests/misc/join.pl +--- coreutils-8.23.orig/tests/misc/join.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/join.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -25,6 +25,15 @@ my $prog = 'join'; @@ -4233,7 +4283,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/join.pl coreutils-8.22/tests/misc/join my $delim = chr 0247; sub t_subst ($) { -@@ -326,8 +335,49 @@ foreach my $t (@tv) +@@ -326,8 +335,49 @@ push @Tests, $new_ent; } @@ -4283,9 +4333,9 @@ diff -urNp coreutils-8.22-orig/tests/misc/join.pl coreutils-8.22/tests/misc/join my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.22-orig/tests/misc/sort-mb-tests.sh coreutils-8.22/tests/misc/sort-mb-tests.sh ---- coreutils-8.22-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.22/tests/misc/sort-mb-tests.sh 2013-12-16 17:40:25.959879222 +0100 +diff -Naur coreutils-8.23.orig/tests/misc/sort-mb-tests.sh coreutils-8.23/tests/misc/sort-mb-tests.sh +--- coreutils-8.23.orig/tests/misc/sort-mb-tests.sh 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-8.23/tests/misc/sort-mb-tests.sh 2014-07-18 22:36:17.399067050 -0500 @@ -0,0 +1,45 @@ +#!/bin/sh +# Verify sort's multi-byte support. @@ -4332,10 +4382,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort-mb-tests.sh coreutils-8.22/tests/ +compare exp out || { fail=1; cat out; } + +Exit $fail -diff -urNp coreutils-8.22-orig/tests/misc/sort-merge.pl coreutils-8.22/tests/misc/sort-merge.pl ---- coreutils-8.22-orig/tests/misc/sort-merge.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/sort-merge.pl 2013-12-16 17:40:25.960878886 +0100 -@@ -26,6 +26,15 @@ my $prog = 'sort'; +diff -Naur coreutils-8.23.orig/tests/misc/sort-merge.pl coreutils-8.23/tests/misc/sort-merge.pl +--- coreutils-8.23.orig/tests/misc/sort-merge.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/sort-merge.pl 2014-07-18 22:36:17.399067050 -0500 +@@ -26,6 +26,15 @@ # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -4351,7 +4401,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort-merge.pl coreutils-8.22/tests/mis # three empty files and one that says 'foo' my @inputs = (+(map{{IN=> {"empty$_"=> ''}}}1..3), {IN=> {foo=> "foo\n"}}); -@@ -77,6 +86,39 @@ my @Tests = +@@ -77,6 +86,39 @@ {OUT=>$big_input}], ); @@ -4391,10 +4441,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort-merge.pl coreutils-8.22/tests/mis my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort.pl ---- coreutils-8.22-orig/tests/misc/sort.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/sort.pl 2013-12-16 17:40:25.962878214 +0100 -@@ -24,10 +24,15 @@ my $prog = 'sort'; +diff -Naur coreutils-8.23.orig/tests/misc/sort.pl coreutils-8.23/tests/misc/sort.pl +--- coreutils-8.23.orig/tests/misc/sort.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/sort.pl 2014-07-18 22:36:17.400067026 -0500 +@@ -24,10 +24,15 @@ # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -4411,7 +4461,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort # Since each test is run with a file name and with redirected stdin, # the name in the diagnostic is either the file name or "-". # Normalize each diagnostic to use '-'. -@@ -415,6 +420,37 @@ foreach my $t (@Tests) +@@ -415,6 +420,37 @@ } } @@ -4440,7 +4490,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort + } + #disable several failing tests until investigation, disable all tests with envvars set + next if (grep {ref $_ eq 'HASH' && exists $_->{ENV}} (@new_t)); -+ next if ($test_name =~ "18g" or $test_name =~ "sort-numeric" or $test_name =~ "08[ab]" or $test_name =~ "03[def]" or $test_name =~ "h4" or $test_name =~ "n1"); ++ next if ($test_name =~ "18g" or $test_name =~ "sort-numeric" or $test_name =~ "08[ab]" or $test_name =~ "03[def]" or $test_name =~ "h4" or $test_name =~ "n1" or $test_name =~ "2[01]a"); + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; + } + push @Tests, @new; @@ -4449,7 +4499,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort @Tests = triple_test \@Tests; # Remember that triple_test creates from each test with exactly one "IN" -@@ -424,6 +460,7 @@ foreach my $t (@Tests) +@@ -424,6 +460,7 @@ # Remove the IN_PIPE version of the "output-is-input" test above. # The others aren't susceptible because they have three inputs each. @Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests; @@ -4457,10 +4507,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/sort.pl coreutils-8.22/tests/misc/sort my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.22-orig/tests/misc/unexpand.pl coreutils-8.22/tests/misc/unexpand.pl ---- coreutils-8.22-orig/tests/misc/unexpand.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/unexpand.pl 2013-12-16 17:40:25.962878214 +0100 -@@ -27,6 +27,14 @@ my $limits = getlimits (); +diff -Naur coreutils-8.23.orig/tests/misc/unexpand.pl coreutils-8.23/tests/misc/unexpand.pl +--- coreutils-8.23.orig/tests/misc/unexpand.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/unexpand.pl 2014-07-18 22:36:17.400067026 -0500 +@@ -27,6 +27,14 @@ my $prog = 'unexpand'; @@ -4475,7 +4525,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/unexpand.pl coreutils-8.22/tests/misc/ my @Tests = ( ['a1', {IN=> ' 'x 1 ."y\n"}, {OUT=> ' 'x 1 ."y\n"}], -@@ -92,6 +100,37 @@ my @Tests = +@@ -92,6 +100,37 @@ {EXIT => 1}, {ERR => "$prog: tab stop value is too large\n"}], ); @@ -4513,10 +4563,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/unexpand.pl coreutils-8.22/tests/misc/ my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.22-orig/tests/misc/uniq.pl coreutils-8.22/tests/misc/uniq.pl ---- coreutils-8.22-orig/tests/misc/uniq.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/uniq.pl 2013-12-16 17:41:34.077961751 +0100 -@@ -23,9 +23,17 @@ my $limits = getlimits (); +diff -Naur coreutils-8.23.orig/tests/misc/uniq.pl coreutils-8.23/tests/misc/uniq.pl +--- coreutils-8.23.orig/tests/misc/uniq.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/misc/uniq.pl 2014-07-18 22:36:17.400067026 -0500 +@@ -23,9 +23,17 @@ my $prog = 'uniq'; my $try = "Try '$prog --help' for more information.\n"; @@ -4534,7 +4584,7 @@ diff -urNp coreutils-8.22-orig/tests/misc/uniq.pl coreutils-8.22/tests/misc/uniq # When possible, create a "-z"-testing variant of each test. sub add_z_variants($) { -@@ -261,6 +269,45 @@ foreach my $t (@Tests) +@@ -261,6 +269,53 @@ and push @$t, {ENV=>'_POSIX2_VERSION=199209'}; } @@ -4561,8 +4611,16 @@ diff -urNp coreutils-8.22-orig/tests/misc/uniq.pl coreutils-8.22/tests/misc/uniq + push @new_t, $sub; + push @$t, $sub; + } -+ next if ($test_name =~ "schar" or $test_name =~ "^obs-plus" -+ or $test_name =~ "119" or $test_name =~ "145"); ++ # In test #145, replace the each ‘...’ by '...'. ++ if ($test_name =~ "145") ++ { ++ my $sub = { ERR_SUBST => "s/‘([^’]+)’/'\$1'/g"}; ++ push @new_t, $sub; ++ push @$t, $sub; ++ } ++ next if ( $test_name =~ "schar" ++ or $test_name =~ "^obs-plus" ++ or $test_name =~ "119"); + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; + } + push @Tests, @new; @@ -4580,10 +4638,10 @@ diff -urNp coreutils-8.22-orig/tests/misc/uniq.pl coreutils-8.22/tests/misc/uniq @Tests = add_z_variants \@Tests; @Tests = triple_test \@Tests; -diff -urNp coreutils-8.22-orig/tests/pr/pr-tests.pl coreutils-8.22/tests/pr/pr-tests.pl ---- coreutils-8.22-orig/tests/pr/pr-tests.pl 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/pr/pr-tests.pl 2013-12-16 17:40:25.965877206 +0100 -@@ -23,6 +23,15 @@ use strict; +diff -Naur coreutils-8.23.orig/tests/pr/pr-tests.pl coreutils-8.23/tests/pr/pr-tests.pl +--- coreutils-8.23.orig/tests/pr/pr-tests.pl 2014-07-11 06:00:07.000000000 -0500 ++++ coreutils-8.23/tests/pr/pr-tests.pl 2014-07-18 22:36:17.401067000 -0500 +@@ -23,6 +23,15 @@ my $prog = 'pr'; @@ -4599,7 +4657,7 @@ diff -urNp coreutils-8.22-orig/tests/pr/pr-tests.pl coreutils-8.22/tests/pr/pr-t my @tv = ( # -b option is no longer an official option. But it's still working to -@@ -466,8 +475,48 @@ push @Tests, +@@ -466,8 +475,48 @@ {IN=>{3=>"x\ty\tz\n"}}, {OUT=>join("\t", qw(a b c m n o x y z)) . "\n"} ]; diff --git a/coreutils.spec b/coreutils.spec index 70f1f09..e60512f 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ %define i18npatch_version %version Name: coreutils -Version: 8.22 +Version: 8.23 Release: 1mamba Summary: A GNU set of tools commonly used in shell scripts Group: System/Tools @@ -12,9 +12,9 @@ Source0: ftp://ftp.gnu.org/gnu/coreutils/%{name}-%{version}.tar.xz Source1: coreutils-pam-su Patch0: %{name}-7.6-langinfo.patch # http://www.linuxfromscratch.org/patches/downloads/coreutils -#Patch2: http://www.linuxfromscratch.org/patches/downloads/coreutils/coreutils-%{i18npatch_version}-i18n-1.patch +Patch2: http://www.linuxfromscratch.org/patches/downloads/coreutils/coreutils-%{i18npatch_version}-i18n-1.patch # or http://pkgs.fedoraproject.org/cgit/coreutils.git/plain/coreutils-i18n.patch -Patch2: coreutils-8.22-i18n.patch +#Patch2: coreutils-8.22-i18n.patch #%{name}-8.16-i18n-1.patch Patch3: %{name}-5.2.1-su_paths.patch Patch5: %{name}-8.4-pam.patch @@ -188,6 +188,9 @@ exit 0 #%doc THANKS THANKS-to-translators THANKStt.in %changelog +* Tue Jul 22 2014 Automatic Build System 8.23-1mamba +- automatic version update by autodist + * Thu Dec 19 2013 Automatic Build System 8.22-1mamba - automatic version update by autodist