]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blobdiff - coreutils/patches/coreutils-i18n.patch
coreutils: Update to 8.13.
[people/amarx/ipfire-3.x.git] / coreutils / patches / coreutils-i18n.patch
index 6e10f376996b64f538259091a524df2249b653fb..9ba6bb4898d95b742f3335f343bcaf448a65d9f6 100644 (file)
@@ -1,6 +1,6 @@
-diff -urNp coreutils-8.10-orig/lib/linebuffer.h coreutils-8.10/lib/linebuffer.h
---- coreutils-8.10-orig/lib/linebuffer.h       2011-01-06 09:47:56.000000000 +0100
-+++ coreutils-8.10/lib/linebuffer.h    2011-02-04 20:13:23.985464731 +0100
+diff -urNp coreutils-8.13-orig/lib/linebuffer.h coreutils-8.13/lib/linebuffer.h
+--- coreutils-8.13-orig/lib/linebuffer.h       2011-04-24 19:21:45.000000000 +0200
++++ coreutils-8.13/lib/linebuffer.h    2011-09-09 10:23:14.163704760 +0200
 @@ -21,6 +21,11 @@
  
  # include <stdio.h>
@@ -23,9 +23,9 @@ diff -urNp coreutils-8.10-orig/lib/linebuffer.h coreutils-8.10/lib/linebuffer.h
  };
  
  /* Initialize linebuffer LINEBUFFER for use. */
-diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
---- coreutils-8.10-orig/src/cut.c      2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/cut.c   2011-02-04 20:13:23.988464025 +0100
+diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
+--- coreutils-8.13-orig/src/cut.c      2011-07-28 12:38:27.000000000 +0200
++++ coreutils-8.13/src/cut.c   2011-09-09 10:23:14.165701039 +0200
 @@ -28,6 +28,11 @@
  #include <assert.h>
  #include <getopt.h>
@@ -75,7 +75,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/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 1. Otherwise 0. */
 +#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
 +  do                                                                        \
 +    {                                                                        \
@@ -226,7 +226,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
      }
  
    max_range_endpoint = 0;
-@@ -580,6 +662,63 @@ cut_bytes (FILE *stream)
+@@ -582,6 +664,77 @@ cut_bytes (FILE *stream)
      }
  }
  
@@ -234,11 +234,11 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
 +/* This function is in use for the following case.
 +
 +   1. Read from the stream STREAM, printing to standard output any selected
-+   characters. 
++   characters.
 +
 +   2. Read from stream STREAM, printing to standard output any selected bytes,
 +   without splitting multibyte characters.  */
-+ 
++
 +static void
 +cut_characters_or_cut_bytes_no_split (FILE *stream)
 +{
@@ -251,6 +251,9 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
 +                           as same character as WC. */
 +  mbstate_t state;        /* State of the stream. */
 +  int convfail = 0;                /* 1, when conversion is failed. Otherwise 0. */
++  /* 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;
 +
 +  idx = 0;
 +  buflen = 0;
@@ -273,12 +276,23 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
 +        {
 +          putchar ('\n');
 +          idx = 0;
++          print_delimiter = false;
 +        }
 +      else
 +        {
++          bool range_start;
++          bool *rs = output_delimiter_specified ? &range_start : NULL;
 +          idx += (operating_mode == byte_mode) ? mblength : 1;
-+          if (print_kth (idx, NULL))
-+            fwrite (bufpos, mblength, sizeof(char), stdout);
++          if (print_kth (idx, rs))
++            {
++              if (rs && *rs && print_delimiter)
++                {
++                  fwrite (output_delimiter_string, sizeof (char),
++                         output_delimiter_length, stdout);
++               }
++              print_delimiter = true;
++              fwrite (bufpos, mblength, sizeof(char), stdout);
++            }
 +        }
 +
 +      buflen -= mblength;
@@ -286,11 +300,11 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
 +    }
 +}
 +#endif
-+                   
++
  /* Read from stream STREAM, printing to standard output any selected fields.  */
  
  static void
-@@ -702,13 +841,192 @@ cut_fields (FILE *stream)
+@@ -704,13 +843,195 @@ cut_fields (FILE *stream)
      }
  }
  
@@ -310,7 +324,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/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;                /* 1, when conversion is failed. Otherwise 0. */
++  int convfail = 0;                /* 1, when conversion is failed. Otherwise 0. */
 +
 +  found_any_selected_field = 0;
 +  field_idx = 1;
@@ -321,7 +335,10 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
 +  c = getc (stream);
 +  empty_input = (c == EOF);
 +  if (c != EOF)
++  {
 +    ungetc (c, stream);
++    wc = 0;
++  }
 +  else
 +    wc = WEOF;
 +
@@ -486,7 +503,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
  }
  
  /* Process file FILE to standard output.
-@@ -760,6 +1078,8 @@ main (int argc, char **argv)
+@@ -762,6 +1080,8 @@ main (int argc, char **argv)
    bool ok;
    bool delim_specified = false;
    char *spec_list_string IF_LINT ( = NULL);
@@ -495,7 +512,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
  
    initialize_main (&argc, &argv);
    set_program_name (argv[0]);
-@@ -782,7 +1102,6 @@ main (int argc, char **argv)
+@@ -784,7 +1104,6 @@ main (int argc, char **argv)
        switch (optc)
          {
          case 'b':
@@ -503,7 +520,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
            /* Build the byte list. */
            if (operating_mode != undefined_mode)
              FATAL_ERROR (_("only one type of list may be specified"));
-@@ -790,6 +1109,14 @@ main (int argc, char **argv)
+@@ -792,6 +1111,14 @@ main (int argc, char **argv)
            spec_list_string = optarg;
            break;
  
@@ -518,7 +535,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
          case 'f':
            /* Build the field list. */
            if (operating_mode != undefined_mode)
-@@ -801,10 +1128,35 @@ main (int argc, char **argv)
+@@ -803,10 +1130,35 @@ main (int argc, char **argv)
          case 'd':
            /* New delimiter. */
            /* Interpret -d '' to mean `use the NUL byte as the delimiter.'  */
@@ -558,7 +575,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
            break;
  
          case OUTPUT_DELIMITER_OPTION:
-@@ -817,6 +1169,7 @@ main (int argc, char **argv)
+@@ -819,6 +1171,7 @@ main (int argc, char **argv)
            break;
  
          case 'n':
@@ -566,7 +583,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
            break;
  
          case 's':
-@@ -839,7 +1192,7 @@ main (int argc, char **argv)
+@@ -841,7 +1194,7 @@ main (int argc, char **argv)
    if (operating_mode == undefined_mode)
      FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
  
@@ -575,7 +592,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
      FATAL_ERROR (_("an input delimiter may be specified only\
   when operating on fields"));
  
-@@ -866,15 +1219,34 @@ main (int argc, char **argv)
+@@ -868,15 +1221,34 @@ main (int argc, char **argv)
      }
  
    if (!delim_specified)
@@ -607,7 +624,7 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
 +      if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
 +#endif
 +        {
-+          static char dummy[2]; 
++          static char dummy[2];
 +          dummy[0] = delim;
 +          dummy[1] = '\0';
 +          output_delimiter_string = dummy;
@@ -616,9 +633,9 @@ diff -urNp coreutils-8.10-orig/src/cut.c coreutils-8.10/src/cut.c
      }
  
    if (optind == argc)
-diff -urNp coreutils-8.10-orig/src/expand.c coreutils-8.10/src/expand.c
---- coreutils-8.10-orig/src/expand.c   2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/expand.c        2011-02-04 20:13:23.990463571 +0100
+diff -urNp coreutils-8.13-orig/src/expand.c coreutils-8.13/src/expand.c
+--- coreutils-8.13-orig/src/expand.c   2011-07-28 12:38:27.000000000 +0200
++++ coreutils-8.13/src/expand.c        2011-09-09 10:23:14.167583399 +0200
 @@ -38,12 +38,29 @@
  #include <stdio.h>
  #include <getopt.h>
@@ -806,9 +823,9 @@ diff -urNp coreutils-8.10-orig/src/expand.c coreutils-8.10/src/expand.c
  
    if (have_read_stdin && fclose (stdin) != 0)
      error (EXIT_FAILURE, errno, "-");
-diff -urNp coreutils-8.10-orig/src/fold.c coreutils-8.10/src/fold.c
---- coreutils-8.10-orig/src/fold.c     2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/fold.c  2011-02-04 20:13:23.992463115 +0100
+diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
+--- coreutils-8.13-orig/src/fold.c     2011-07-28 12:38:27.000000000 +0200
++++ coreutils-8.13/src/fold.c  2011-09-09 10:23:14.169583741 +0200
 @@ -22,12 +22,34 @@
  #include <getopt.h>
  #include <sys/types.h>
@@ -1179,7 +1196,7 @@ diff -urNp coreutils-8.10-orig/src/fold.c coreutils-8.10/src/fold.c
    if (ferror (istream))
      {
        error (0, saved_errno, "%s", filename);
-@@ -254,7 +502,8 @@ main (int argc, char **argv)
+@@ -254,7 +501,8 @@ main (int argc, char **argv)
  
    atexit (close_stdout);
  
@@ -1189,7 +1206,7 @@ diff -urNp coreutils-8.10-orig/src/fold.c coreutils-8.10/src/fold.c
  
    while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
      {
-@@ -263,7 +512,15 @@ main (int argc, char **argv)
+@@ -263,7 +511,15 @@ main (int argc, char **argv)
        switch (optc)
          {
          case 'b':             /* Count bytes rather than columns. */
@@ -1206,9 +1223,9 @@ diff -urNp coreutils-8.10-orig/src/fold.c coreutils-8.10/src/fold.c
            break;
  
          case 's':             /* Break at word boundaries. */
-diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
---- coreutils-8.10-orig/src/join.c     2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/join.c  2011-02-04 20:20:15.985114387 +0100
+diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
+--- coreutils-8.13-orig/src/join.c     2011-08-08 10:16:09.000000000 +0200
++++ coreutils-8.13/src/join.c  2011-09-09 10:23:14.172687087 +0200
 @@ -22,18 +22,32 @@
  #include <sys/types.h>
  #include <getopt.h>
@@ -1243,7 +1260,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
  /* The official name of this program (e.g., no `g' prefix).  */
  #define PROGRAM_NAME "join"
  
-@@ -129,10 +143,12 @@ static struct outlist outlist_head;
+@@ -135,10 +149,12 @@ static struct outlist outlist_head;
  /* Last element in `outlist', where a new element can be added.  */
  static struct outlist *outlist_end = &outlist_head;
  
@@ -1260,7 +1277,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
  
  /* If nonzero, check that the input is correctly ordered. */
  static enum
-@@ -257,13 +273,14 @@ xfields (struct line *line)
+@@ -263,13 +279,14 @@ xfields (struct line *line)
    if (ptr == lim)
      return;
  
@@ -1278,7 +1295,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
      {
        /* Skip leading blanks before the first field.  */
        while (isblank (to_uchar (*ptr)))
-@@ -287,6 +304,148 @@ xfields (struct line *line)
+@@ -293,6 +310,148 @@ xfields (struct line *line)
    extract_field (line, ptr, lim - ptr);
  }
  
@@ -1427,7 +1444,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
  static void
  freeline (struct line *line)
  {
-@@ -308,56 +467,115 @@ keycmp (struct line const *line1, struct
+@@ -314,56 +473,115 @@ keycmp (struct line const *line1, struct
          size_t jf_1, size_t jf_2)
  {
    /* Start of field to compare in each file.  */
@@ -1551,7 +1568,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
 -        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[1] = (unsigned char *) beg[1];
      }
  
 +  if (hard_LC_COLLATE)
@@ -1566,9 +1583,9 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
  }
  
  /* Check that successive input lines PREV and CURRENT from input file
-@@ -438,6 +656,11 @@ get_line (FILE *fp, struct line **linep,
-       return false;
+@@ -455,6 +673,11 @@ get_line (FILE *fp, struct line **linep,
      }
+   ++line_no[which - 1];
  
 +#if HAVE_MBRTOWC
 +  if (MB_CUR_MAX > 1)
@@ -1578,7 +1595,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
    xfields (line);
  
    if (prevline[which - 1])
-@@ -537,21 +760,28 @@ prfield (size_t n, struct line const *li
+@@ -554,21 +777,28 @@ prfield (size_t n, struct line const *li
  
  /* Output all the fields in line, other than the join field.  */
  
@@ -1610,7 +1627,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
        prfield (i, line);
      }
  }
-@@ -562,7 +792,6 @@ static void
+@@ -579,7 +809,6 @@ static void
  prjoin (struct line const *line1, struct line const *line2)
  {
    const struct outlist *outlist;
@@ -1618,7 +1635,7 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
    size_t field;
    struct line const *line;
  
-@@ -596,7 +825,7 @@ prjoin (struct line const *line1, struct
+@@ -613,7 +842,7 @@ prjoin (struct line const *line1, struct
            o = o->next;
            if (o == NULL)
              break;
@@ -1627,12 +1644,12 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
          }
        putchar ('\n');
      }
-@@ -1075,21 +1304,46 @@ main (int argc, char **argv)
+@@ -1091,21 +1320,46 @@ main (int argc, char **argv)
  
          case 't':
            {
 -            unsigned char newtab = optarg[0];
-+            char *newtab;
++            char *newtab = NULL;
 +            size_t newtablen;
 +            newtab = xstrdup (optarg);
 +#if HAVE_MBRTOWC
@@ -1654,7 +1671,8 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
 +              newtablen = 1;
              if (! newtab)
 +            {
-               newtab = '\n'; /* '' => process the whole line.  */
+-              newtab = '\n'; /* '' => process the whole line.  */
++              newtab = "\n"; /* '' => process the whole line.  */
 +            }
              else if (optarg[1])
                {
@@ -1683,9 +1701,9 @@ diff -urNp coreutils-8.10-orig/src/join.c coreutils-8.10/src/join.c
            break;
  
          case NOCHECK_ORDER_OPTION:
-diff -urNp coreutils-8.10-orig/src/pr.c coreutils-8.10/src/pr.c
---- coreutils-8.10-orig/src/pr.c       2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/pr.c    2011-02-04 20:13:24.002460897 +0100
+diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
+--- coreutils-8.13-orig/src/pr.c       2011-08-30 23:01:40.000000000 +0200
++++ coreutils-8.13/src/pr.c    2011-09-09 10:23:14.177658905 +0200
 @@ -312,6 +312,32 @@
  
  #include <getopt.h>
@@ -2408,9 +2426,9 @@ diff -urNp coreutils-8.10-orig/src/pr.c coreutils-8.10/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.10-orig/src/sort.c coreutils-8.10/src/sort.c
---- coreutils-8.10-orig/src/sort.c     2011-02-03 11:24:35.000000000 +0100
-+++ coreutils-8.10/src/sort.c  2011-02-04 20:15:44.160384535 +0100
+diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
+--- coreutils-8.13-orig/src/sort.c     2011-07-29 10:12:25.000000000 +0200
++++ coreutils-8.13/src/sort.c  2011-09-09 10:23:14.183686800 +0200
 @@ -22,11 +22,20 @@
  
  #include <config.h>
@@ -2432,7 +2450,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  #include "system.h"
  #include "argmatch.h"
  #include "error.h"
-@@ -163,12 +172,34 @@ static int thousands_sep;
+@@ -167,12 +176,34 @@ static int thousands_sep;
  
  /* Nonzero if the corresponding locales are hard.  */
  static bool hard_LC_COLLATE;
@@ -2468,7 +2486,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  /* The kind of blanks for '-b' to skip in various options. */
  enum blanktype { bl_start, bl_end, bl_both };
  
-@@ -335,13 +366,11 @@ static bool reverse;
+@@ -343,13 +374,11 @@ static bool reverse;
     they were read if all keys compare equal.  */
  static bool stable;
  
@@ -2485,7 +2503,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  
  /* Flag to remove consecutive duplicate lines from the output.
     Only the last of a sequence of equal lines will be output. */
-@@ -775,6 +804,46 @@ reap_all (void)
+@@ -783,6 +812,46 @@ reap_all (void)
      reap (-1);
  }
  
@@ -2532,7 +2550,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  /* Clean up any remaining temporary files.  */
  
  static void
-@@ -1207,7 +1276,7 @@ zaptemp (char const *name)
+@@ -1215,7 +1284,7 @@ zaptemp (char const *name)
    free (node);
  }
  
@@ -2541,7 +2559,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  
  static int
  struct_month_cmp (void const *m1, void const *m2)
-@@ -1222,7 +1291,7 @@ struct_month_cmp (void const *m1, void c
+@@ -1230,7 +1299,7 @@ struct_month_cmp (void const *m1, void c
  /* Initialize the character class tables. */
  
  static void
@@ -2550,7 +2568,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  {
    size_t i;
  
-@@ -1234,7 +1303,7 @@ inittables (void)
+@@ -1242,7 +1311,7 @@ inittables (void)
        fold_toupper[i] = toupper (i);
      }
  
@@ -2559,7 +2577,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
    /* If we're not in the "C" locale, read different names for months.  */
    if (hard_LC_TIME)
      {
-@@ -1316,6 +1385,84 @@ specify_nmerge (int oi, char c, char con
+@@ -1324,6 +1393,84 @@ specify_nmerge (int oi, char c, char con
      xstrtol_fatal (e, oi, c, long_options, s);
  }
  
@@ -2644,7 +2662,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/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)
-@@ -1544,7 +1691,7 @@ buffer_linelim (struct buffer const *buf
+@@ -1552,7 +1699,7 @@ buffer_linelim (struct buffer const *buf
     by KEY in LINE. */
  
  static char *
@@ -2653,7 +2671,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  {
    char *ptr = line->text, *lim = ptr + line->length - 1;
    size_t sword = key->sword;
-@@ -1553,10 +1700,10 @@ begfield (struct line const *line, struc
+@@ -1561,10 +1708,10 @@ begfield (struct line const *line, struc
    /* The leading field separator itself is included in a field when -t
       is absent.  */
  
@@ -2666,7 +2684,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
            ++ptr;
          if (ptr < lim)
            ++ptr;
-@@ -1582,11 +1729,70 @@ begfield (struct line const *line, struc
+@@ -1590,11 +1737,70 @@ begfield (struct line const *line, struc
    return ptr;
  }
  
@@ -2738,7 +2756,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  {
    char *ptr = line->text, *lim = ptr + line->length - 1;
    size_t eword = key->eword, echar = key->echar;
-@@ -1601,10 +1807,10 @@ limfield (struct line const *line, struc
+@@ -1609,10 +1815,10 @@ limfield (struct line const *line, struc
       `beginning' is the first character following the delimiting TAB.
       Otherwise, leave PTR pointing at the first `blank' character after
       the preceding field.  */
@@ -2751,7 +2769,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
            ++ptr;
          if (ptr < lim && (eword || echar))
            ++ptr;
-@@ -1650,10 +1856,10 @@ limfield (struct line const *line, struc
+@@ -1658,10 +1864,10 @@ limfield (struct line const *line, struc
       */
  
    /* Make LIM point to the end of (one byte past) the current field.  */
@@ -2764,7 +2782,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
        if (newlim)
          lim = newlim;
      }
-@@ -1684,6 +1890,130 @@ limfield (struct line const *line, struc
+@@ -1692,6 +1898,130 @@ limfield (struct line const *line, struc
    return ptr;
  }
  
@@ -2895,7 +2913,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/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
-@@ -1770,8 +2100,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
+@@ -1778,8 +2108,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
                    else
                      {
                        if (key->skipsblanks)
@@ -2920,7 +2938,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
                        line->keybeg = line_start;
                      }
                  }
-@@ -1892,7 +2236,7 @@ human_numcompare (char const *a, char co
+@@ -1900,7 +2244,7 @@ human_numcompare (char const *a, char co
     hideously fast. */
  
  static int
@@ -2929,7 +2947,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  {
    while (blanks[to_uchar (*a)])
      a++;
-@@ -1902,6 +2246,25 @@ numcompare (char const *a, char const *b
+@@ -1910,6 +2254,25 @@ numcompare (char const *a, char const *b
    return strnumcmp (a, b, decimal_point, thousands_sep);
  }
  
@@ -2955,7 +2973,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  static int
  general_numcompare (char const *sa, char const *sb)
  {
-@@ -1934,7 +2297,7 @@ general_numcompare (char const *sa, char
+@@ -1942,7 +2305,7 @@ general_numcompare (char const *sa, char
     Return 0 if the name in S is not recognized.  */
  
  static int
@@ -2964,7 +2982,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  {
    size_t lo = 0;
    size_t hi = MONTHS_PER_YEAR;
-@@ -2209,15 +2572,14 @@ debug_key (struct line const *line, stru
+@@ -2217,15 +2580,14 @@ debug_key (struct line const *line, stru
            char saved = *lim;
            *lim = '\0';
  
@@ -2982,7 +3000,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
            else if (key->general_numeric)
              ignore_value (strtold (beg, &tighter_lim));
            else if (key->numeric || key->human_numeric)
-@@ -2361,7 +2723,7 @@ key_warnings (struct keyfield const *gke
+@@ -2369,7 +2731,7 @@ key_warnings (struct keyfield const *gke
        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  */
@@ -2991,7 +3009,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
            && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
                || (!key->skipsblanks && key->schar)
                || (!key->skipeblanks && key->echar)))
-@@ -2419,11 +2781,83 @@ key_warnings (struct keyfield const *gke
+@@ -2427,11 +2789,83 @@ key_warnings (struct keyfield const *gke
      error (0, 0, _("option `-r' only applies to last-resort comparison"));
  }
  
@@ -3076,7 +3094,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
  {
    struct keyfield *key = keylist;
  
-@@ -2508,7 +2942,7 @@ keycompare (struct line const *a, struct
+@@ -2516,7 +2950,7 @@ keycompare (struct line const *a, struct
            else if (key->human_numeric)
              diff = human_numcompare (ta, tb);
            else if (key->month)
@@ -3085,7 +3103,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
            else if (key->random)
              diff = compare_random (ta, tlena, tb, tlenb);
            else if (key->version)
-@@ -2624,6 +3058,179 @@ keycompare (struct line const *a, struct
+@@ -2632,6 +3066,180 @@ keycompare (struct line const *a, struct
    return key->reverse ? -diff : diff;
  }
  
@@ -3167,7 +3185,8 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
 +              if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1)        \
 +                STATE = state_bak;                                        \
 +              if (!ignore)                                                \
-+                COPY[NEW_LEN++] = TEXT[i++];                                \
++                COPY[NEW_LEN++] = TEXT[i];                                \
++              i++;                                                         \
 +              continue;                                                        \
 +            }                                                                \
 +                                                                        \
@@ -3265,7 +3284,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/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. */
  
-@@ -4087,7 +4694,7 @@ main (int argc, char **argv)
+@@ -4095,7 +4702,7 @@ main (int argc, char **argv)
    initialize_exit_failure (SORT_FAILURE);
  
    hard_LC_COLLATE = hard_locale (LC_COLLATE);
@@ -3274,7 +3293,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
    hard_LC_TIME = hard_locale (LC_TIME);
  #endif
  
-@@ -4108,6 +4715,29 @@ main (int argc, char **argv)
+@@ -4116,6 +4723,29 @@ main (int argc, char **argv)
        thousands_sep = -1;
    }
  
@@ -3304,7 +3323,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
    have_read_stdin = false;
    inittables ();
  
-@@ -4378,13 +5008,34 @@ main (int argc, char **argv)
+@@ -4386,13 +5016,34 @@ main (int argc, char **argv)
  
          case 't':
            {
@@ -3343,7 +3362,7 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
                  else
                    {
                      /* Provoke with `sort -txx'.  Complain about
-@@ -4395,9 +5046,12 @@ main (int argc, char **argv)
+@@ -4403,9 +5054,12 @@ main (int argc, char **argv)
                             quote (optarg));
                    }
                }
@@ -3358,9 +3377,9 @@ diff -urNp coreutils-8.10-orig/src/sort.c coreutils-8.10/src/sort.c
            }
            break;
  
-diff -urNp coreutils-8.10-orig/src/unexpand.c coreutils-8.10/src/unexpand.c
---- coreutils-8.10-orig/src/unexpand.c 2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/unexpand.c      2011-02-04 20:13:24.015458014 +0100
+diff -urNp coreutils-8.13-orig/src/unexpand.c coreutils-8.13/src/unexpand.c
+--- coreutils-8.13-orig/src/unexpand.c 2011-07-28 12:38:27.000000000 +0200
++++ coreutils-8.13/src/unexpand.c      2011-09-09 10:23:14.185647633 +0200
 @@ -39,12 +39,29 @@
  #include <stdio.h>
  #include <getopt.h>
@@ -3614,9 +3633,9 @@ diff -urNp coreutils-8.10-orig/src/unexpand.c coreutils-8.10/src/unexpand.c
  
    if (have_read_stdin && fclose (stdin) != 0)
      error (EXIT_FAILURE, errno, "-");
-diff -urNp coreutils-8.10-orig/src/uniq.c coreutils-8.10/src/uniq.c
---- coreutils-8.10-orig/src/uniq.c     2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/src/uniq.c  2011-02-04 20:13:24.018457349 +0100
+diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
+--- coreutils-8.13-orig/src/uniq.c     2011-07-28 12:38:27.000000000 +0200
++++ coreutils-8.13/src/uniq.c  2011-09-09 10:24:19.631560964 +0200
 @@ -21,6 +21,16 @@
  #include <getopt.h>
  #include <sys/types.h>
@@ -3669,7 +3688,7 @@ diff -urNp coreutils-8.10-orig/src/uniq.c coreutils-8.10/src/uniq.c
 @@ -207,7 +233,7 @@ size_opt (char const *opt, char const *m
     return a pointer to the beginning of the line's field to be compared. */
  
- static char *
+ static char * _GL_ATTRIBUTE_PURE
 -find_field (struct linebuffer const *line)
 +find_field_uni (struct linebuffer *line)
  {
@@ -3952,7 +3971,7 @@ diff -urNp coreutils-8.10-orig/src/uniq.c coreutils-8.10/src/uniq.c
            match = !different (thisfield, prevfield, thislen, prevlen);
            match_count += match;
  
-@@ -383,6 +612,9 @@ check_file (const char *infile, const ch
+@@ -383,6 +611,9 @@ check_file (const char *infile, const ch
                SWAP_LINES (prevline, thisline);
                prevfield = thisfield;
                prevlen = thislen;
@@ -3962,7 +3981,7 @@ diff -urNp coreutils-8.10-orig/src/uniq.c coreutils-8.10/src/uniq.c
                if (!match)
                  match_count = 0;
              }
-@@ -428,6 +660,19 @@ main (int argc, char **argv)
+@@ -428,6 +659,19 @@ main (int argc, char **argv)
  
    atexit (close_stdout);
  
@@ -3982,10 +4001,10 @@ diff -urNp coreutils-8.10-orig/src/uniq.c coreutils-8.10/src/uniq.c
    skip_chars = 0;
    skip_fields = 0;
    check_chars = SIZE_MAX;
-diff -urNp coreutils-8.10-orig/tests/Makefile.am coreutils-8.10/tests/Makefile.am
---- coreutils-8.10-orig/tests/Makefile.am      2011-02-04 20:12:58.236173903 +0100
-+++ coreutils-8.10/tests/Makefile.am   2011-02-04 20:13:24.020456905 +0100
-@@ -235,6 +235,7 @@ TESTS =                                            \
+diff -urNp coreutils-8.13-orig/tests/Makefile.am coreutils-8.13/tests/Makefile.am
+--- coreutils-8.13-orig/tests/Makefile.am      2011-09-09 10:22:43.352561668 +0200
++++ coreutils-8.13/tests/Makefile.am   2011-09-09 10:23:14.189688942 +0200
+@@ -238,6 +238,7 @@ TESTS =                                            \
    misc/sort-debug-keys                                \
    misc/sort-debug-warn                                \
    misc/sort-files0-from                               \
@@ -3993,7 +4012,7 @@ diff -urNp coreutils-8.10-orig/tests/Makefile.am coreutils-8.10/tests/Makefile.a
    misc/sort-float                             \
    misc/sort-merge                             \
    misc/sort-merge-fdlimit                     \
-@@ -505,6 +506,10 @@ TESTS =                                           \
+@@ -518,6 +519,10 @@ TESTS =                                           \
    $(root_tests)
  
  pr_data =                                     \
@@ -4004,10 +4023,21 @@ diff -urNp coreutils-8.10-orig/tests/Makefile.am coreutils-8.10/tests/Makefile.a
    pr/0F                                               \
    pr/0FF                                      \
    pr/0FFnt                                    \
-diff -urNp coreutils-8.10-orig/tests/misc/cut coreutils-8.10/tests/misc/cut
---- coreutils-8.10-orig/tests/misc/cut 2011-01-31 13:40:38.000000000 +0100
-+++ coreutils-8.10/tests/misc/cut      2011-02-04 20:13:24.021456684 +0100
-@@ -26,7 +26,7 @@ use strict;
+diff -urNp coreutils-8.13-orig/tests/misc/cut coreutils-8.13/tests/misc/cut
+--- coreutils-8.13-orig/tests/misc/cut 2011-09-02 14:08:40.000000000 +0200
++++ coreutils-8.13/tests/misc/cut      2011-09-09 10:23:14.190686793 +0200
+@@ -23,14 +23,15 @@ my $mb_locale = $ENV{LOCALE_FR_UTF8};
+ # Turn off localization of executable's output.
+ @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
+-my $mb_locale = $ENV{LOCALE_FR_UTF8};
+-! defined $mb_locale || $mb_locale eq 'none'
+-  and $mb_locale = 'C';
++#my $mb_locale = $ENV{LOCALE_FR_UTF8};
++#! defined $mb_locale || $mb_locale eq 'none'
++#  and $mb_locale = 'C';
++my $mb_locale = 'C';
  my $prog = 'cut';
  my $try = "Try \`$prog --help' for more information.\n";
  my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
@@ -4016,7 +4046,7 @@ diff -urNp coreutils-8.10-orig/tests/misc/cut coreutils-8.10/tests/misc/cut
  my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";
  
  my @Tests =
-@@ -143,7 +143,7 @@ my @Tests =
+@@ -147,7 +147,7 @@ my @Tests =
  
    # None of the following invalid ranges provoked an error up to coreutils-6.9.
    ['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},
@@ -4025,41 +4055,41 @@ diff -urNp coreutils-8.10-orig/tests/misc/cut coreutils-8.10/tests/misc/cut
    ['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
    ['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
    ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1},
-diff -urNp coreutils-8.10-orig/tests/misc/mb1.I coreutils-8.10/tests/misc/mb1.I
---- coreutils-8.10-orig/tests/misc/mb1.I       1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.10/tests/misc/mb1.I    2011-02-04 20:13:24.022456462 +0100
+diff -urNp coreutils-8.13-orig/tests/misc/mb1.I coreutils-8.13/tests/misc/mb1.I
+--- coreutils-8.13-orig/tests/misc/mb1.I       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.13/tests/misc/mb1.I    2011-09-09 10:23:14.191687037 +0200
 @@ -0,0 +1,4 @@
 +Apple@10
 +Banana@5
 +Citrus@20
 +Cherry@30
-diff -urNp coreutils-8.10-orig/tests/misc/mb1.X coreutils-8.10/tests/misc/mb1.X
---- coreutils-8.10-orig/tests/misc/mb1.X       1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.10/tests/misc/mb1.X    2011-02-04 20:13:24.023456240 +0100
+diff -urNp coreutils-8.13-orig/tests/misc/mb1.X coreutils-8.13/tests/misc/mb1.X
+--- coreutils-8.13-orig/tests/misc/mb1.X       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.13/tests/misc/mb1.X    2011-09-09 10:23:14.192581910 +0200
 @@ -0,0 +1,4 @@
 +Banana@5
 +Apple@10
 +Citrus@20
 +Cherry@30
-diff -urNp coreutils-8.10-orig/tests/misc/mb2.I coreutils-8.10/tests/misc/mb2.I
---- coreutils-8.10-orig/tests/misc/mb2.I       1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.10/tests/misc/mb2.I    2011-02-04 20:13:24.024456019 +0100
+diff -urNp coreutils-8.13-orig/tests/misc/mb2.I coreutils-8.13/tests/misc/mb2.I
+--- coreutils-8.13-orig/tests/misc/mb2.I       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.13/tests/misc/mb2.I    2011-09-09 10:23:14.192581910 +0200
 @@ -0,0 +1,4 @@
 +Apple@AA10@@20
 +Banana@AA5@@30
 +Citrus@AA20@@5
 +Cherry@AA30@@10
-diff -urNp coreutils-8.10-orig/tests/misc/mb2.X coreutils-8.10/tests/misc/mb2.X
---- coreutils-8.10-orig/tests/misc/mb2.X       1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.10/tests/misc/mb2.X    2011-02-04 20:13:24.024456019 +0100
+diff -urNp coreutils-8.13-orig/tests/misc/mb2.X coreutils-8.13/tests/misc/mb2.X
+--- coreutils-8.13-orig/tests/misc/mb2.X       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.13/tests/misc/mb2.X    2011-09-09 10:23:14.193687456 +0200
 @@ -0,0 +1,4 @@
 +Citrus@AA20@@5
 +Cherry@AA30@@10
 +Apple@AA10@@20
 +Banana@AA5@@30
-diff -urNp coreutils-8.10-orig/tests/misc/sort-mb-tests coreutils-8.10/tests/misc/sort-mb-tests
---- coreutils-8.10-orig/tests/misc/sort-mb-tests       1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.10/tests/misc/sort-mb-tests    2011-02-04 20:13:24.025455797 +0100
+diff -urNp coreutils-8.13-orig/tests/misc/sort-mb-tests coreutils-8.13/tests/misc/sort-mb-tests
+--- coreutils-8.13-orig/tests/misc/sort-mb-tests       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.13/tests/misc/sort-mb-tests    2011-09-09 10:23:14.194687565 +0200
 @@ -0,0 +1,58 @@
 +#! /bin/sh
 +case $# in
@@ -4079,7 +4109,7 @@ diff -urNp coreutils-8.10-orig/tests/misc/sort-mb-tests coreutils-8.10/tests/mis
 +$xx -t @ -k2 -n misc/mb1.I > misc/mb1.O
 +code=$?
 +if test $code != 0; then
-+  $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
++  $echo "Test mb1 failed: $xx return code $code differs from expected value 0"
 +  errors=`expr $errors + 1`
 +else
 +  cmp misc/mb1.O $srcdir/misc/mb1.X > /dev/null 2>&1