]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/commitdiff
coreutils: Update to 8.16.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 1 Apr 2012 14:44:45 +0000 (16:44 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 1 Apr 2012 14:44:45 +0000 (16:44 +0200)
coreutils/coreutils.nm
coreutils/patches/coreutils-7.6-uname_PIC-1.patch.off [deleted file]
coreutils/patches/coreutils-8.5-pam.patch
coreutils/patches/coreutils-i18n.patch
coreutils/patches/coreutils-selinux.patch

index 6b65353266fa4dc0758c5cbe1a32977ac1861706..4fb5490c921ca5e065dffe19ecbe8f32ad8b9fa0 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = coreutils
-version    = 8.15
+version    = 8.16
 release    = 1
 
 groups     = System/Base
@@ -38,6 +38,8 @@ build
                -D_GNU_SOURCE=1 \
                -fno-strict-aliasing
 
+       export FORCE_UNSAFE_CONFIGURE=1
+
        configure_options += \
                --libexecdir=%{libdir} \
                --enable-pam \
@@ -45,7 +47,8 @@ build
                --enable-largefile \
                --disable-rpath \
                --enable-install-program=arch,su \
-               --enable-no-install-program=hostname,kill,uptime
+               --enable-no-install-program=hostname,kill,uptime \
+               --with-tty-group
 
        prepare_cmds
                aclocal -I m4
diff --git a/coreutils/patches/coreutils-7.6-uname_PIC-1.patch.off b/coreutils/patches/coreutils-7.6-uname_PIC-1.patch.off
deleted file mode 100644 (file)
index 0ae413f..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-Submitted By: Robert Connolly <robert@linuxfromscratch.org> (ashes)
-Date: 2005-11-13
-Initial Package Version: 5.93
-Upstream Status: pending
-Origin: Scot McPherson and Zack Winkles
-Description: Fix the output of uname once and for all. This is the position independent
-version.
-
-       $ uname -m      # This always worked.
-       i686
-       $ uname -i      # Used to report 'unknown'.
-       i386
-       $ uname -p      # Likewise.
-       athlon-4
-
-Now 'uname -p' can be used by GCC's mtune/mcpu and march options. For example:
-
-       CFLAGS="-march=$(uname -m) -mtune=$(uname -p)"
-
-diff -Naur coreutils-5.93.orig/src/uname.c coreutils-5.93/src/uname.c
---- coreutils-5.93.orig/src/uname.c    2005-09-15 19:57:04.000000000 +0000
-+++ coreutils-5.93/src/uname.c 2005-11-13 19:18:35.000000000 +0000
-@@ -29,6 +29,26 @@
- # include <sys/systeminfo.h>
- #endif
-+#ifdef linux
-+/* Thanks to the ffmpeg team for this PIC version of cpuid() */
-+#ifdef ARCH_X86_64
-+#  define REG_b "rbx"
-+#  define REG_S "rsi"
-+#else
-+#  define REG_b "ebx"
-+#  define REG_S "esi"
-+#endif
-+#define cpuid(index,eax,ebx,ecx,edx)\
-+      __asm __volatile\
-+        ("mov %%"REG_b", %%"REG_S"\n\t"\
-+        "cpuid\n\t"\
-+        "xchg %%"REG_b", %%"REG_S\
-+        : "=a" (eax), "=S" (ebx),\
-+        "=c" (ecx), "=d" (edx)\
-+        : "0" (index));
-+int has_sse( void );
-+#endif
-+
- #if HAVE_SYS_SYSCTL_H
- # if HAVE_SYS_PARAM_H
- #  include <sys/param.h> /* needed for OpenBSD 3.0 */
-@@ -256,6 +276,99 @@
-       if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
-         element = processor;
-       }
-+#else
-+      {
-+      struct utsname u;
-+      uname (&u);
-+      element = u.machine;
-+#ifdef linux
-+/******************************************************************************
-+ *
-+ * Hello, major hack.  I shouldn't have to do this.  struct utsname should
-+ * have another element with this info in it.  There's probably a struct
-+ * somewhere that has this info, I just don't know where it is.
-+ *
-+ *****************************************************************************/
-+
-+      if( !strcmp( element, "i586" ) || !strcmp( element, "i686" ) ) {
-+        int eax, ebx, ecx, edx, unused;
-+        int model, family, sse;
-+     
-+        cpuid(0,unused,ebx,ecx,edx);
-+        cpuid(1,eax,unused,unused,unused);
-+        model = (eax >> 4) & 0xf;
-+        family = (eax >> 8) & 0xf;
-+
-+        switch(ebx) {
-+        case 0x756e6547: // Intel
-+          switch( family ) {
-+          case 5: // Pentium
-+            if( model <= 3 )
-+              element="pentium";
-+            if( model > 3 )
-+              element="pentium-mmx";
-+            break;
-+          case 6: // PentiumPro - Pentium III
-+            if( model == 1 ) // Pentium Pro
-+              element="pentiumpro";
-+            if( ( model == 3 ) || ( model == 5 ) ||
-+                ( model == 6 ) ) // Pentium II
-+              element="pentium2";
-+            if( ( model == 7 ) || ( model == 8 ) ||
-+                ( model == 10 ) || ( model == 11 ) ) // These are all Pentium III
-+              element="pentium3";
-+            break;
-+          case 15: // Pentium4
-+            if( model == 3 ) // Prescott
-+                element="prescott";
-+            else
-+            element="pentium4";
-+            break;
-+          default:
-+            break;
-+          } // end switch( family )
-+          break;
-+        case 0x68747541: // AMD
-+          switch(family) {
-+          case 5:
-+            if( ( model == 0 ) || ( model == 1 ) || 
-+                ( model == 2 ) || ( model == 3 ) ) // K5
-+              element="i586";
-+            if( ( model == 6 ) || ( model == 7 ) ) // K6
-+              element="k6";
-+            if( model == 8 ) // K6-2
-+              element="k6-2";
-+            if( model == 9 ) // K6-3
-+              element="k6-3";
-+            break;
-+          case 6:
-+            if( model <= 4 )
-+              element="athlon";
-+            if( model > 4 ) {
-+              sse = has_sse();
-+              if( sse == 0 )
-+                element="athlon";
-+              if( sse == 1 )
-+                element="athlon-4";
-+            }
-+            break;
-+          case 15:
-+            element="athlon-4";
-+            break;
-+          default:
-+            break;
-+          } // end switch( family )
-+          break;
-+        case 0x69727943: // Cyrix
-+          element="i386"; // who knows what cyrix supports, lets be safe
-+          break;
-+        default:
-+          break;
-+        } // end switch(ebx)
-+      }
-+
-+#endif
-+      }
- #endif
- #ifdef UNAME_PROCESSOR
-       if (element == unknown)
-@@ -293,7 +406,7 @@
-   if (toprint & PRINT_HARDWARE_PLATFORM)
-     {
--      char const *element = unknown;
-+      char *element = unknown;
- #if HAVE_SYSINFO && defined SI_PLATFORM
-       {
-       static char hardware_platform[257];
-@@ -301,6 +414,15 @@
-                         hardware_platform, sizeof hardware_platform))
-         element = hardware_platform;
-       }
-+#else
-+      {
-+      struct utsname u;
-+      uname (&u);
-+      element = u.machine;
-+      if (strlen (element) == 4 && element[0] == 'i' && element[2] == '8'
-+          && element[3] == '6')
-+        element[1] = '3';
-+      }
- #endif
- #ifdef UNAME_HARDWARE_PLATFORM
-       if (element == unknown)
-@@ -323,3 +445,29 @@
-   exit (EXIT_SUCCESS);
- }
-+
-+#ifdef linux
-+
-+/******************************************************************************
-+ *
-+ * int has_sse( void )
-+ * Checks Athlon CPU's to see if they support SSE.
-+ *
-+ *****************************************************************************/
-+
-+int has_sse( void )
-+{
-+  unsigned long edx, unused;
-+  int sse;
-+  cpuid(1,unused,unused,unused,edx);
-+  // I think, I need this tested on a Duron with SSE
-+  // and one without it.
-+  sse = edx & 0x2000000;
-+  if( sse == 0 ) {
-+    return 0;
-+  } else {
-+    return 1;
-+  }
-+
-+}
-+#endif
index 71b85e7a451f291363b86351e2d4d494b1bcfcd0..3d0e416b0d75e05e60e47336d99e3c7ad52d041c 100644 (file)
@@ -1,19 +1,7 @@
-From ea2d050b1952feb99f86c98255280beb6e589d8c Mon Sep 17 00:00:00 2001
-From: Ludwig Nussel <ludwig.nussel@suse.de>
-Date: Tue, 17 Aug 2010 13:21:44 +0200
-Subject: [PATCH 1/7] pam support for su
-
----
- configure.ac    |   14 +++
- src/Makefile.am |    4 +-
- src/su.c        |  266 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
- 3 files changed, 278 insertions(+), 6 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index b07a52b..1fb5839 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -128,6 +128,20 @@ fi
+diff -urNp coreutils-8.16-orig/configure.ac coreutils-8.16/configure.ac
+--- coreutils-8.16-orig/configure.ac   2012-03-24 19:22:13.000000000 +0100
++++ coreutils-8.16/configure.ac        2012-03-26 17:59:07.900139497 +0200
+@@ -185,6 +185,20 @@ fi
  
  AC_FUNC_FORK
  
@@ -34,11 +22,34 @@ index b07a52b..1fb5839 100644
  optional_bin_progs=
  AC_CHECK_FUNCS([chroot],
          gl_ADD_PROG([optional_bin_progs], [chroot]))
-diff --git a/src/Makefile.am b/src/Makefile.am
-index db5359b..154a5ed 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -363,8 +363,8 @@ factor_LDADD += $(LIB_GMP)
+diff -urNp coreutils-8.16-orig/doc/coreutils.texi coreutils-8.16/doc/coreutils.texi
+--- coreutils-8.16-orig/doc/coreutils.texi     2012-03-26 17:58:27.624763998 +0200
++++ coreutils-8.16/doc/coreutils.texi  2012-03-26 17:59:07.907138599 +0200
+@@ -15804,7 +15804,9 @@ the exit status of @var{command} otherwi
+ @command{su} allows one user to temporarily become another user.  It runs a
+ command (often an interactive shell) with the real and effective user
+-ID, group ID, and supplemental groups of a given @var{user}.  Synopsis:
++ID, group ID, and supplemental groups of a given @var{user}. When the -l
++option is given, the su-l PAM file is used instead of the default su PAM file.
++Synopsis:
+ @example
+ su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
+@@ -15883,7 +15885,8 @@ environment variables except @env{TERM},
+ (which are set, even for the super-user, as described above), and set
+ @env{PATH} to a compiled-in default value.  Change to @var{user}'s home
+ directory.  Prepend @samp{-} to the shell's name, intended to make it
+-read its login startup file(s).
++read its login startup file(s). When this option is given, /etc/pam.d/su-l
++PAM file is used instead of the default one.
+ @item -m
+ @itemx -p
+diff -urNp coreutils-8.16-orig/src/Makefile.am coreutils-8.16/src/Makefile.am
+--- coreutils-8.16-orig/src/Makefile.am        2012-03-24 19:22:13.000000000 +0100
++++ coreutils-8.16/src/Makefile.am     2012-03-26 17:59:07.928142551 +0200
+@@ -357,8 +357,8 @@ factor_LDADD += $(LIB_GMP)
  # for getloadavg
  uptime_LDADD += $(GETLOADAVG_LIBS)
  
@@ -49,10 +60,9 @@ index db5359b..154a5ed 100644
  
  # for various ACL functions
  copy_LDADD += $(LIB_ACL)
-diff --git a/src/su.c b/src/su.c
-index f8f5b61..811aad7 100644
---- a/src/su.c
-+++ b/src/su.c
+diff -urNp coreutils-8.16-orig/src/su.c coreutils-8.16/src/su.c
+--- coreutils-8.16-orig/src/su.c       2012-03-26 17:58:27.629764055 +0200
++++ coreutils-8.16/src/su.c    2012-03-26 17:59:07.931138998 +0200
 @@ -37,6 +37,16 @@
     restricts who can su to UID 0 accounts.  RMS considers that to
     be fascist.
@@ -84,7 +94,7 @@ index f8f5b61..811aad7 100644
  
  #include "system.h"
  #include "getpass.h"
-@@ -111,7 +128,9 @@
+@@ -120,7 +137,9 @@
  /* The user to become if none is specified.  */
  #define DEFAULT_USER "root"
  
@@ -94,7 +104,7 @@ index f8f5b61..811aad7 100644
  
  static void run_shell (char const *, char const *, char **, size_t)
       ATTRIBUTE_NORETURN;
-@@ -125,6 +144,11 @@ static bool simulate_login;
+@@ -134,6 +153,11 @@ static bool simulate_login;
  /* If true, change some environment vars to indicate the user su'd to.  */
  static bool change_environment;
  
@@ -106,7 +116,7 @@ index f8f5b61..811aad7 100644
  static struct option const longopts[] =
  {
    {"command", required_argument, NULL, 'c'},
-@@ -200,7 +224,164 @@ log_su (struct passwd const *pw, bool successful)
+@@ -212,7 +236,174 @@ log_su (struct passwd const *pw, bool su
  }
  #endif
  
@@ -168,7 +178,7 @@ index f8f5b61..811aad7 100644
 +create_watching_parent (void)
 +{
 +  pid_t child;
-+  sigset_t ourset;
++  sigset_t ourset, blockset;
 +  int status = 0;
 +
 +  retval = pam_open_session (pamh, 0);
@@ -230,7 +240,17 @@ index f8f5b61..811aad7 100644
 +
 +        if (pid != (pid_t)-1 && WIFSTOPPED (status))
 +          {
++       /* tcsh sends SIGTSTP to the process group, and so is already pending */
 +            kill (getpid (), SIGSTOP);
++             if (WSTOPSIG(status) != SIGSTOP) {
++               sigemptyset(&blockset);
++               if (sigaddset(&blockset, WSTOPSIG(status)) ||
++                   sigprocmask(SIG_UNBLOCK, &blockset, &ourset) ||
++                   sigprocmask(SIG_SETMASK, &ourset, NULL))
++                {
++                   error (0, errno, _("cannot set signal handler"));
++                }
++             }
 +            /* once we get here, we must have resumed */
 +            kill (pid, SIGCONT);
 +          }
@@ -271,7 +291,7 @@ index f8f5b61..811aad7 100644
     Return true if the user gives the correct password for entry PW,
     false if not.  Return true without asking for a password if run by UID 0
     or if PW has an empty password.  */
-@@ -208,10 +389,52 @@ log_su (struct passwd const *pw, bool successful)
+@@ -220,10 +411,52 @@ log_su (struct passwd const *pw, bool su
  static bool
  correct_password (const struct passwd *pw)
  {
@@ -325,15 +345,15 @@ index f8f5b61..811aad7 100644
  
    endspent ();
    if (sp)
-@@ -232,6 +455,7 @@ correct_password (const struct passwd *pw)
+@@ -244,6 +477,7 @@ correct_password (const struct passwd *p
    encrypted = crypt (unencrypted, correct);
    memset (unencrypted, 0, strlen (unencrypted));
    return STREQ (encrypted, correct);
 +#endif /* !USE_PAM */
  }
  
- /* Update `environ' for the new shell based on PW, with SHELL being
-@@ -274,19 +498,41 @@ modify_environment (const struct passwd *pw, const char *shell)
+ /* Update 'environ' for the new shell based on PW, with SHELL being
+@@ -286,19 +520,41 @@ modify_environment (const struct passwd 
              }
          }
      }
@@ -377,7 +397,7 @@ index f8f5b61..811aad7 100644
    if (setgid (pw->pw_gid))
      error (EXIT_CANCELED, errno, _("cannot set group id"));
    if (setuid (pw->pw_uid))
-@@ -500,9 +746,21 @@ main (int argc, char **argv)
+@@ -511,9 +767,21 @@ main (int argc, char **argv)
        shell = NULL;
      }
    shell = xstrdup (shell ? shell : pw->pw_shell);
@@ -400,29 +420,3 @@ index f8f5b61..811aad7 100644
    if (simulate_login && chdir (pw->pw_dir) != 0)
      error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
  
--- 
-1.7.1
-diff -urNp coreutils-8.7-orig/doc/coreutils.texi coreutils-8.7/doc/coreutils.texi
---- coreutils-8.7-orig/doc/coreutils.texi      2010-11-15 12:47:03.529922880 +0100
-+++ coreutils-8.7/doc/coreutils.texi   2010-11-15 12:49:55.945171380 +0100
-@@ -15180,7 +15180,9 @@ the exit status of @var{command} otherwi
- @command{su} allows one user to temporarily become another user.  It runs a
- command (often an interactive shell) with the real and effective user
--ID, group ID, and supplemental groups of a given @var{user}.  Synopsis:
-+ID, group ID, and supplemental groups of a given @var{user}. When the -l
-+option is given, the su-l PAM file is used instead of the default su PAM file.
-+Synopsis:
- @example
- su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
-@@ -15259,7 +15261,8 @@ environment variables except @env{TERM},
- (which are set, even for the super-user, as described above), and set
- @env{PATH} to a compiled-in default value.  Change to @var{user}'s home
- directory.  Prepend @samp{-} to the shell's name, intended to make it
--read its login startup file(s).
-+read its login startup file(s). When this option is given, /etc/pam.d/su-l
-+PAM file is used instead of the default one.
- @item -m
- @itemx -p
index e2f9f21ed09bb1d5a8adac0fba8970f81399273e..ee2cf73aa6940f82c0aa6b61393e1f173149997a 100644 (file)
@@ -1,6 +1,6 @@
-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
+diff -urNp coreutils-8.16-orig/lib/linebuffer.h coreutils-8.16/lib/linebuffer.h
+--- coreutils-8.16-orig/lib/linebuffer.h       2012-01-06 10:14:31.000000000 +0100
++++ coreutils-8.16/lib/linebuffer.h    2012-03-26 18:02:00.993889446 +0200
 @@ -21,6 +21,11 @@
  
  # include <stdio.h>
@@ -23,9 +23,9 @@ diff -urNp coreutils-8.13-orig/lib/linebuffer.h coreutils-8.13/lib/linebuffer.h
  };
  
  /* Initialize linebuffer LINEBUFFER for use. */
-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
+diff -urNp coreutils-8.16-orig/src/cut.c coreutils-8.16/src/cut.c
+--- coreutils-8.16-orig/src/cut.c      2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/cut.c   2012-03-26 17:46:48.000000000 +0200
 @@ -28,6 +28,11 @@
  #include <assert.h>
  #include <getopt.h>
@@ -54,7 +54,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
 +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
 +#endif
 +
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
  #define PROGRAM_NAME "cut"
  
 @@ -72,6 +89,52 @@
@@ -118,7 +118,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
 +/* The largest byte, character or field index used as an endpoint of a closed
     or degenerate range specification;  this doesn't include the starting
     index of right-open-ended ranges.  For example, with either range spec
-    `2-5,9-', `2-3,5,9-' this variable would be set to 5.  */
+    '2-5,9-', '2-3,5,9-' this variable would be set to 5.  */
 @@ -102,10 +165,11 @@ static size_t eol_range_start;
  
  /* This is a bit vector.
@@ -170,7 +170,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
  
  /* True if the --output-delimiter=STRING option was specified.  */
  static bool output_delimiter_specified;
-@@ -207,7 +284,7 @@ Mandatory arguments to long options are 
+@@ -206,7 +283,7 @@ Mandatory arguments to long options are 
    -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\
@@ -179,7 +179,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
  "), stdout);
        fputs (_("\
        --complement        complement the set of selected bytes, characters\n\
-@@ -366,7 +443,7 @@ set_fields (const char *fieldstr)
+@@ -365,7 +442,7 @@ set_fields (const char *fieldstr)
            in_digits = false;
            /* Starting a range. */
            if (dash_found)
@@ -188,10 +188,10 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
            dash_found = true;
            fieldstr++;
  
-@@ -390,14 +467,16 @@ set_fields (const char *fieldstr)
+@@ -389,14 +466,16 @@ set_fields (const char *fieldstr)
                if (!rhs_specified)
                  {
-                   /* `n-'.  From `initial' to end of line. */
+                   /* 'n-'.  From 'initial' to end of line. */
 -                  eol_range_start = initial;
 +                  if (eol_range_start == 0 ||
 +                      (eol_range_start != 0 && eol_range_start > initial))
@@ -200,14 +200,14 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
                  }
                else
                  {
-                   /* `m-n' or `-n' (1-n). */
+                   /* 'm-n' or '-n' (1-n). */
                    if (value < initial)
 -                    FATAL_ERROR (_("invalid decreasing range"));
 +                    FATAL_ERROR (_("invalid byte, character or field list"));
  
                    /* Is there already a range going to end of line? */
                    if (eol_range_start != 0)
-@@ -477,6 +556,9 @@ set_fields (const char *fieldstr)
+@@ -476,6 +555,9 @@ set_fields (const char *fieldstr)
                if (operating_mode == byte_mode)
                  error (0, 0,
                         _("byte offset %s is too large"), quote (bad_num));
@@ -217,7 +217,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
                else
                  error (0, 0,
                         _("field number %s is too large"), quote (bad_num));
-@@ -487,7 +569,7 @@ set_fields (const char *fieldstr)
+@@ -486,7 +568,7 @@ set_fields (const char *fieldstr)
            fieldstr++;
          }
        else
@@ -226,7 +226,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
      }
  
    max_range_endpoint = 0;
-@@ -582,6 +664,77 @@ cut_bytes (FILE *stream)
+@@ -581,6 +663,77 @@ cut_bytes (FILE *stream)
      }
  }
  
@@ -304,7 +304,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
  /* Read from stream STREAM, printing to standard output any selected fields.  */
  
  static void
-@@ -704,13 +843,195 @@ cut_fields (FILE *stream)
+@@ -703,13 +856,195 @@ cut_fields (FILE *stream)
      }
  }
  
@@ -503,7 +503,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
  }
  
  /* Process file FILE to standard output.
-@@ -762,6 +1080,8 @@ main (int argc, char **argv)
+@@ -761,6 +1096,8 @@ main (int argc, char **argv)
    bool ok;
    bool delim_specified = false;
    char *spec_list_string IF_LINT ( = NULL);
@@ -512,7 +512,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
  
    initialize_main (&argc, &argv);
    set_program_name (argv[0]);
-@@ -784,7 +1104,6 @@ main (int argc, char **argv)
+@@ -783,7 +1120,6 @@ main (int argc, char **argv)
        switch (optc)
          {
          case 'b':
@@ -520,7 +520,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
            /* Build the byte list. */
            if (operating_mode != undefined_mode)
              FATAL_ERROR (_("only one type of list may be specified"));
-@@ -792,6 +1111,14 @@ main (int argc, char **argv)
+@@ -791,6 +1127,14 @@ main (int argc, char **argv)
            spec_list_string = optarg;
            break;
  
@@ -535,10 +535,10 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
          case 'f':
            /* Build the field list. */
            if (operating_mode != undefined_mode)
-@@ -803,10 +1130,35 @@ main (int argc, char **argv)
+@@ -802,10 +1146,35 @@ main (int argc, char **argv)
          case 'd':
            /* New delimiter. */
-           /* Interpret -d '' to mean `use the NUL byte as the delimiter.'  */
+           /* Interpret -d '' to mean 'use the NUL byte as the delimiter.'  */
 -          if (optarg[0] != '\0' && optarg[1] != '\0')
 -            FATAL_ERROR (_("the delimiter must be a single character"));
 -          delim = optarg[0];
@@ -575,7 +575,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
            break;
  
          case OUTPUT_DELIMITER_OPTION:
-@@ -819,6 +1171,7 @@ main (int argc, char **argv)
+@@ -818,6 +1187,7 @@ main (int argc, char **argv)
            break;
  
          case 'n':
@@ -583,7 +583,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
            break;
  
          case 's':
-@@ -841,7 +1194,7 @@ main (int argc, char **argv)
+@@ -840,7 +1210,7 @@ main (int argc, char **argv)
    if (operating_mode == undefined_mode)
      FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
  
@@ -592,7 +592,7 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
      FATAL_ERROR (_("an input delimiter may be specified only\
   when operating on fields"));
  
-@@ -868,15 +1221,34 @@ main (int argc, char **argv)
+@@ -867,15 +1237,34 @@ main (int argc, char **argv)
      }
  
    if (!delim_specified)
@@ -633,10 +633,10 @@ diff -urNp coreutils-8.13-orig/src/cut.c coreutils-8.13/src/cut.c
      }
  
    if (optind == argc)
-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 @@
+diff -urNp coreutils-8.16-orig/src/expand.c coreutils-8.16/src/expand.c
+--- coreutils-8.16-orig/src/expand.c   2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/expand.c        2012-03-26 17:42:56.000000000 +0200
+@@ -37,12 +37,29 @@
  #include <stdio.h>
  #include <getopt.h>
  #include <sys/types.h>
@@ -663,10 +663,10 @@ diff -urNp coreutils-8.13-orig/src/expand.c coreutils-8.13/src/expand.c
 +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
 +#endif
 +
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
  #define PROGRAM_NAME "expand"
  
-@@ -360,6 +377,142 @@ expand (void)
+@@ -358,6 +375,142 @@ expand (void)
      }
  }
  
@@ -809,7 +809,7 @@ diff -urNp coreutils-8.13-orig/src/expand.c coreutils-8.13/src/expand.c
  int
  main (int argc, char **argv)
  {
-@@ -424,7 +577,12 @@ main (int argc, char **argv)
+@@ -422,7 +575,12 @@ main (int argc, char **argv)
  
    file_list = (optind < argc ? &argv[optind] : stdin_argv);
  
@@ -823,9 +823,9 @@ diff -urNp coreutils-8.13-orig/src/expand.c coreutils-8.13/src/expand.c
  
    if (have_read_stdin && fclose (stdin) != 0)
      error (EXIT_FAILURE, errno, "-");
-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
+diff -urNp coreutils-8.16-orig/src/fold.c coreutils-8.16/src/fold.c
+--- coreutils-8.16-orig/src/fold.c     2012-03-24 19:22:13.000000000 +0100
++++ coreutils-8.16/src/fold.c  2012-03-26 17:48:37.000000000 +0200
 @@ -22,12 +22,34 @@
  #include <getopt.h>
  #include <sys/types.h>
@@ -860,7 +860,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
 +
  #define TAB_WIDTH 8
  
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
 @@ -35,20 +57,41 @@
  
  #define AUTHORS proper_name ("David MacKenzie")
@@ -907,7 +907,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
    {"spaces", no_argument, NULL, 's'},
    {"width", required_argument, NULL, 'w'},
    {GETOPT_HELP_OPTION_DECL},
-@@ -78,6 +121,7 @@ Mandatory arguments to long options are 
+@@ -77,6 +120,7 @@ Mandatory arguments to long options are 
  "), stdout);
        fputs (_("\
    -b, --bytes         count bytes rather than columns\n\
@@ -915,7 +915,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
    -s, --spaces        break at spaces\n\
    -w, --width=WIDTH   use WIDTH columns instead of 80\n\
  "), stdout);
-@@ -95,7 +139,7 @@ Mandatory arguments to long options are 
+@@ -94,7 +138,7 @@ Mandatory arguments to long options are 
  static size_t
  adjust_column (size_t column, char c)
  {
@@ -924,7 +924,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
      {
        if (c == '\b')
          {
-@@ -118,30 +162,14 @@ adjust_column (size_t column, char c)
+@@ -117,30 +161,14 @@ adjust_column (size_t column, char c)
     to stdout, with maximum line length WIDTH.
     Return true if successful.  */
  
@@ -936,7 +936,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
 -  FILE *istream;
    int c;
    size_t column = 0;          /* Screen column where next char will go. */
-   size_t offset_out = 0;      /* Index in `line_out' for next char. */
+   size_t offset_out = 0;      /* Index in 'line_out' for next char. */
    static char *line_out = NULL;
    static size_t allocated_out = 0;
 -  int saved_errno;
@@ -957,7 +957,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
  
    fadvise (istream, FADVISE_SEQUENTIAL);
  
-@@ -171,6 +199,15 @@ fold_file (char const *filename, size_t 
+@@ -170,6 +198,15 @@ fold_file (char const *filename, size_t 
                bool found_blank = false;
                size_t logical_end = offset_out;
  
@@ -973,7 +973,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
                /* Look for the last blank. */
                while (logical_end)
                  {
-@@ -217,11 +254,221 @@ fold_file (char const *filename, size_t 
+@@ -216,11 +253,221 @@ fold_file (char const *filename, size_t 
        line_out[offset_out++] = c;
      }
  
@@ -1196,7 +1196,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
    if (ferror (istream))
      {
        error (0, saved_errno, "%s", filename);
-@@ -254,7 +501,8 @@ main (int argc, char **argv)
+@@ -253,7 +500,8 @@ main (int argc, char **argv)
  
    atexit (close_stdout);
  
@@ -1206,7 +1206,7 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
  
    while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
      {
-@@ -263,7 +511,15 @@ main (int argc, char **argv)
+@@ -262,7 +510,15 @@ main (int argc, char **argv)
        switch (optc)
          {
          case 'b':             /* Count bytes rather than columns. */
@@ -1223,9 +1223,9 @@ diff -urNp coreutils-8.13-orig/src/fold.c coreutils-8.13/src/fold.c
            break;
  
          case 's':             /* Break at word boundaries. */
-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
+diff -urNp coreutils-8.16-orig/src/join.c coreutils-8.16/src/join.c
+--- coreutils-8.16-orig/src/join.c     2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/join.c  2012-03-26 17:50:02.000000000 +0200
 @@ -22,18 +22,32 @@
  #include <sys/types.h>
  #include <getopt.h>
@@ -1257,11 +1257,11 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
 +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
 +#endif
 +
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
  #define PROGRAM_NAME "join"
  
 @@ -135,10 +149,12 @@ static struct outlist outlist_head;
- /* Last element in `outlist', where a new element can be added.  */
+ /* Last element in 'outlist', where a new element can be added.  */
  static struct outlist *outlist_end = &outlist_head;
  
 -/* Tab character separating fields.  If negative, fields are separated
@@ -1277,7 +1277,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
  
  /* If nonzero, check that the input is correctly ordered. */
  static enum
-@@ -263,13 +279,14 @@ xfields (struct line *line)
+@@ -262,13 +278,14 @@ xfields (struct line *line)
    if (ptr == lim)
      return;
  
@@ -1295,7 +1295,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
      {
        /* Skip leading blanks before the first field.  */
        while (isblank (to_uchar (*ptr)))
-@@ -293,6 +310,148 @@ xfields (struct line *line)
+@@ -292,6 +309,148 @@ xfields (struct line *line)
    extract_field (line, ptr, lim - ptr);
  }
  
@@ -1444,7 +1444,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
  static void
  freeline (struct line *line)
  {
-@@ -314,56 +473,115 @@ keycmp (struct line const *line1, struct
+@@ -313,56 +472,115 @@ keycmp (struct line const *line1, struct
          size_t jf_1, size_t jf_2)
  {
    /* Start of field to compare in each file.  */
@@ -1583,7 +1583,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
  }
  
  /* Check that successive input lines PREV and CURRENT from input file
-@@ -455,6 +673,11 @@ get_line (FILE *fp, struct line **linep,
+@@ -454,6 +672,11 @@ get_line (FILE *fp, struct line **linep,
      }
    ++line_no[which - 1];
  
@@ -1595,7 +1595,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
    xfields (line);
  
    if (prevline[which - 1])
-@@ -554,21 +777,28 @@ prfield (size_t n, struct line const *li
+@@ -553,21 +776,28 @@ prfield (size_t n, struct line const *li
  
  /* Output all the fields in line, other than the join field.  */
  
@@ -1627,7 +1627,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
        prfield (i, line);
      }
  }
-@@ -579,7 +809,6 @@ static void
+@@ -578,7 +808,6 @@ static void
  prjoin (struct line const *line1, struct line const *line2)
  {
    const struct outlist *outlist;
@@ -1635,7 +1635,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
    size_t field;
    struct line const *line;
  
-@@ -613,7 +842,7 @@ prjoin (struct line const *line1, struct
+@@ -612,7 +841,7 @@ prjoin (struct line const *line1, struct
            o = o->next;
            if (o == NULL)
              break;
@@ -1644,7 +1644,7 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
          }
        putchar ('\n');
      }
-@@ -1091,21 +1320,46 @@ main (int argc, char **argv)
+@@ -1090,21 +1319,46 @@ main (int argc, char **argv)
  
          case 't':
            {
@@ -1670,8 +1670,8 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
 +#endif
 +              newtablen = 1;
              if (! newtab)
-+            {
 -              newtab = '\n'; /* '' => process the whole line.  */
++            {
 +              newtab = "\n"; /* '' => process the whole line.  */
 +            }
              else if (optarg[1])
@@ -1701,9 +1701,9 @@ diff -urNp coreutils-8.13-orig/src/join.c coreutils-8.13/src/join.c
            break;
  
          case NOCHECK_ORDER_OPTION:
-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
+diff -urNp coreutils-8.16-orig/src/pr.c coreutils-8.16/src/pr.c
+--- coreutils-8.16-orig/src/pr.c       2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/pr.c    2012-03-26 17:50:48.000000000 +0200
 @@ -312,6 +312,32 @@
  
  #include <getopt.h>
@@ -1753,7 +1753,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
 +extern int wcwidth ();
 +#endif
 +
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
  #define PROGRAM_NAME "pr"
  
 @@ -415,7 +453,20 @@ struct COLUMN
@@ -1786,7 +1786,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
                         int *number);
  static void print_files (int number_of_files, char **av);
  static void init_parameters (int number_of_files);
-@@ -439,7 +491,6 @@ static void store_char (char c);
+@@ -438,7 +490,6 @@ static void store_char (char c);
  static void pad_down (int lines);
  static void read_rest_of_line (COLUMN *p);
  static void skip_read (COLUMN *p, int column_number);
@@ -1794,7 +1794,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  static void cleanup (void);
  static void print_sep_string (void);
  static void separator_string (const char *optarg_S);
-@@ -451,7 +502,7 @@ static COLUMN *column_vector;
+@@ -450,7 +501,7 @@ static COLUMN *column_vector;
     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]. */
@@ -1803,7 +1803,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
  /* Index of the position in buff where the next character
     will be stored. */
-@@ -555,7 +606,7 @@ static int chars_per_column;
+@@ -554,7 +605,7 @@ static int chars_per_column;
  static bool untabify_input = false;
  
  /* (-e) The input tab character. */
@@ -1812,7 +1812,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
  /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
     where the leftmost column is 1. */
-@@ -565,7 +616,10 @@ static int chars_per_input_tab = 8;
+@@ -564,7 +615,10 @@ static int chars_per_input_tab = 8;
  static bool tabify_output = false;
  
  /* (-i) The output tab character. */
@@ -1824,7 +1824,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
  /* (-i) The width of the output tab. */
  static int chars_per_output_tab = 8;
-@@ -639,7 +693,13 @@ static int power_10;
+@@ -638,7 +692,13 @@ static int power_10;
  static bool numbered_lines = false;
  
  /* (-n) Character which follows each line number. */
@@ -1839,15 +1839,15 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
  /* (-n) line counting starts with 1st line of input file (not with 1st
     line of 1st page printed). */
-@@ -692,6 +752,7 @@ static bool use_col_separator = false;
-    -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
+@@ -691,6 +751,7 @@ static bool use_col_separator = false;
+    -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;
 +static int col_sep_width = 0;
  static char *column_separator = (char *) " ";
  static char *line_separator = (char *) "\t";
  
-@@ -848,6 +909,13 @@ separator_string (const char *optarg_S)
+@@ -847,6 +908,13 @@ separator_string (const char *optarg_S)
    col_sep_length = (int) strlen (optarg_S);
    col_sep_string = xmalloc (col_sep_length + 1);
    strcpy (col_sep_string, optarg_S);
@@ -1861,7 +1861,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  }
  
  int
-@@ -872,6 +940,21 @@ main (int argc, char **argv)
+@@ -871,6 +939,21 @@ main (int argc, char **argv)
  
    atexit (close_stdout);
  
@@ -1883,7 +1883,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
    n_files = 0;
    file_names = (argc > 1
                  ? xmalloc ((argc - 1) * sizeof (char *))
-@@ -948,8 +1031,12 @@ main (int argc, char **argv)
+@@ -947,8 +1030,12 @@ main (int argc, char **argv)
            break;
          case 'e':
            if (optarg)
@@ -1898,7 +1898,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            /* Could check tab width > 0. */
            untabify_input = true;
            break;
-@@ -962,8 +1049,12 @@ main (int argc, char **argv)
+@@ -961,8 +1048,12 @@ main (int argc, char **argv)
            break;
          case 'i':
            if (optarg)
@@ -1913,7 +1913,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            /* Could check tab width > 0. */
            tabify_output = true;
            break;
-@@ -990,8 +1081,8 @@ main (int argc, char **argv)
+@@ -989,8 +1080,8 @@ main (int argc, char **argv)
          case 'n':
            numbered_lines = true;
            if (optarg)
@@ -1924,7 +1924,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            break;
          case 'N':
            skip_count = false;
-@@ -1030,7 +1121,7 @@ main (int argc, char **argv)
+@@ -1029,7 +1120,7 @@ main (int argc, char **argv)
            old_s = false;
            /* Reset an additional input of -s, -S dominates -s */
            col_sep_string = bad_cast ("");
@@ -1933,7 +1933,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            use_col_separator = true;
            if (optarg)
              separator_string (optarg);
-@@ -1187,10 +1278,45 @@ main (int argc, char **argv)
+@@ -1186,10 +1277,45 @@ main (int argc, char **argv)
     a number. */
  
  static void
@@ -1981,7 +1981,19 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
    if (*arg)
      {
        long int tmp_long;
-@@ -1249,7 +1375,7 @@ init_parameters (int number_of_files)
+@@ -1211,6 +1337,11 @@ static void
+ init_parameters (int number_of_files)
+ {
+   int chars_used_by_number = 0;
++  int mb_len = 1;
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    mb_len = MB_LEN_MAX;
++#endif
+   lines_per_body = lines_per_page - lines_per_header - lines_per_footer;
+   if (lines_per_body <= 0)
+@@ -1248,7 +1379,7 @@ init_parameters (int number_of_files)
            else
              col_sep_string = column_separator;
  
@@ -1990,7 +2002,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            use_col_separator = true;
          }
        /* It's rather pointless to define a TAB separator with column
-@@ -1280,11 +1406,11 @@ init_parameters (int number_of_files)
+@@ -1279,11 +1410,11 @@ init_parameters (int number_of_files)
               TAB_WIDTH (chars_per_input_tab, chars_per_number);   */
  
        /* Estimate chars_per_text without any margin and keep it constant. */
@@ -2004,7 +2016,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
        /* The number is part of the column width unless we are
           printing files in parallel. */
-@@ -1299,7 +1425,7 @@ init_parameters (int number_of_files)
+@@ -1298,7 +1429,7 @@ init_parameters (int number_of_files)
      }
  
    chars_per_column = (chars_per_line - chars_used_by_number -
@@ -2013,7 +2025,16 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
    if (chars_per_column < 1)
      error (EXIT_FAILURE, 0, _("page width too narrow"));
-@@ -1424,7 +1550,7 @@ init_funcs (void)
+@@ -1315,7 +1446,7 @@ init_parameters (int number_of_files)
+      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);
+-  clump_buff = xmalloc (MAX (8, chars_per_input_tab));
++  clump_buff = xmalloc (mb_len * MAX (8, chars_per_input_tab));
+ }
\f
+ /* Open the necessary files,
+@@ -1423,7 +1554,7 @@ init_funcs (void)
  
    /* Enlarge p->start_position of first column to use the same form of
       padding_not_printed with all columns. */
@@ -2022,7 +2043,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
    /* This loop takes care of all but the rightmost column. */
  
-@@ -1458,7 +1584,7 @@ init_funcs (void)
+@@ -1457,7 +1588,7 @@ init_funcs (void)
          }
        else
          {
@@ -2031,7 +2052,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            h_next = h + chars_per_column;
          }
      }
-@@ -1749,9 +1875,9 @@ static void
+@@ -1748,9 +1879,9 @@ static void
  align_column (COLUMN *p)
  {
    padding_not_printed = p->start_position;
@@ -2043,7 +2064,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
        padding_not_printed = ANYWHERE;
      }
  
-@@ -2022,13 +2148,13 @@ store_char (char c)
+@@ -2021,13 +2152,13 @@ store_char (char c)
        /* May be too generous. */
        buff = X2REALLOC (buff, &buff_allocated);
      }
@@ -2059,9 +2080,9 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
    char *s;
    int left_cut;
  
-@@ -2051,22 +2177,24 @@ add_line_number (COLUMN *p)
+@@ -2050,22 +2181,24 @@ add_line_number (COLUMN *p)
        /* Tabification is assumed for multiple columns, also for n-separators,
-          but `default n-separator = TAB' hasn't been given priority over
+          but 'default n-separator = TAB' hasn't been given priority over
           equal column_width also specified by POSIX. */
 -      if (number_separator == '\t')
 +      if (number_separator[0] == '\t')
@@ -2088,7 +2109,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
          output_position = POS_AFTER_TAB (chars_per_output_tab,
                            output_position);
      }
-@@ -2227,7 +2355,7 @@ print_white_space (void)
+@@ -2226,7 +2359,7 @@ print_white_space (void)
    while (goal - h_old > 1
           && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
      {
@@ -2097,7 +2118,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
        h_old = h_new;
      }
    while (++h_old <= goal)
-@@ -2247,6 +2375,7 @@ print_sep_string (void)
+@@ -2246,6 +2379,7 @@ print_sep_string (void)
  {
    char *s;
    int l = col_sep_length;
@@ -2105,7 +2126,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  
    s = col_sep_string;
  
-@@ -2260,6 +2389,7 @@ print_sep_string (void)
+@@ -2259,6 +2393,7 @@ print_sep_string (void)
      {
        for (; separators_not_printed > 0; --separators_not_printed)
          {
@@ -2113,7 +2134,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            while (l-- > 0)
              {
                /* 3 types of sep_strings: spaces only, spaces and chars,
-@@ -2273,12 +2403,15 @@ print_sep_string (void)
+@@ -2272,12 +2407,15 @@ print_sep_string (void)
                  }
                else
                  {
@@ -2130,7 +2151,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            /* sep_string ends with some spaces */
            if (spaces_not_printed > 0)
              print_white_space ();
-@@ -2306,7 +2439,7 @@ print_clump (COLUMN *p, int n, char *clu
+@@ -2305,7 +2443,7 @@ print_clump (COLUMN *p, int n, char *clu
     required number of tabs and spaces. */
  
  static void
@@ -2139,7 +2160,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  {
    if (tabify_output)
      {
-@@ -2330,6 +2463,74 @@ print_char (char c)
+@@ -2329,6 +2467,74 @@ print_char (char c)
    putchar (c);
  }
  
@@ -2214,7 +2235,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  /* Skip to page PAGE before printing.
     PAGE may be larger than total number of pages. */
  
-@@ -2509,9 +2710,9 @@ read_line (COLUMN *p)
+@@ -2508,9 +2714,9 @@ read_line (COLUMN *p)
            align_empty_cols = false;
          }
  
@@ -2226,7 +2247,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
            padding_not_printed = ANYWHERE;
          }
  
-@@ -2612,9 +2813,9 @@ print_stored (COLUMN *p)
+@@ -2611,9 +2817,9 @@ print_stored (COLUMN *p)
          }
      }
  
@@ -2238,7 +2259,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
        padding_not_printed = ANYWHERE;
      }
  
-@@ -2627,8 +2828,8 @@ print_stored (COLUMN *p)
+@@ -2626,8 +2832,8 @@ print_stored (COLUMN *p)
    if (spaces_not_printed == 0)
      {
        output_position = p->start_position + end_vector[line];
@@ -2249,7 +2270,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
      }
  
    return true;
-@@ -2647,7 +2848,7 @@ print_stored (COLUMN *p)
+@@ -2646,7 +2852,7 @@ print_stored (COLUMN *p)
     number of characters is 1.) */
  
  static int
@@ -2258,7 +2279,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
  {
    unsigned char uc = c;
    char *s = clump_buff;
-@@ -2657,10 +2858,10 @@ char_to_clump (char c)
+@@ -2656,10 +2862,10 @@ char_to_clump (char c)
    int chars;
    int chars_per_c = 8;
  
@@ -2271,7 +2292,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
      {
        width = TAB_WIDTH (chars_per_c, input_position);
  
-@@ -2741,6 +2942,155 @@ char_to_clump (char c)
+@@ -2740,6 +2946,154 @@ char_to_clump (char c)
    return chars;
  }
  
@@ -2279,7 +2300,6 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
 +static int
 +char_to_clump_multi (char c)
 +{
-+  unsigned char uc = c;
 +  static size_t mbc_pos = 0;
 +  static char mbc[MB_LEN_MAX] = {'\0'};
 +  static mbstate_t state = {'\0'};
@@ -2317,7 +2337,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
 +              width = +4;
 +              chars = +4;
 +              *s++ = '\\';
-+              sprintf (esc_buff, "%03o", mbc[0]);
++              sprintf (esc_buff, "%03o", (unsigned char) mbc[0]);
 +              for (i = 0; i <= 2; ++i)
 +                *s++ = (int) esc_buff[i];
 +            }
@@ -2366,7 +2386,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
 +                      width += 4;
 +                      chars += 4;
 +                      *s++ = '\\';
-+                      sprintf (esc_buff, "%03o", uc);
++                      sprintf (esc_buff, "%03o", (unsigned char) mbc[i]);
 +                      for (j = 0; j <= 2; ++j)
 +                        *s++ = (int) esc_buff[j];
 +                    }
@@ -2387,7 +2407,7 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/src/pr.c
 +                          width += 4;
 +                          chars += 4;
 +                          *s++ = '\\';
-+                          sprintf (esc_buff, "%03o", uc);
++                          sprintf (esc_buff, "%03o", (unsigned char) mbc[i]);
 +                          for (j = 0; j <= 2; ++j)
 +                            *s++ = (int) esc_buff[j];
 +                        }
@@ -2427,9 +2447,9 @@ diff -urNp coreutils-8.13-orig/src/pr.c coreutils-8.13/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.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
+diff -urNp coreutils-8.16-orig/src/sort.c coreutils-8.16/src/sort.c
+--- coreutils-8.16-orig/src/sort.c     2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/sort.c  2012-03-26 17:35:09.000000000 +0200
 @@ -22,11 +22,20 @@
  
  #include <config.h>
@@ -2504,7 +2524,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  
  /* Flag to remove consecutive duplicate lines from the output.
     Only the last of a sequence of equal lines will be output. */
-@@ -783,6 +812,46 @@ reap_all (void)
+@@ -782,6 +811,46 @@ reap_all (void)
      reap (-1);
  }
  
@@ -2551,7 +2571,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  /* Clean up any remaining temporary files.  */
  
  static void
-@@ -1215,7 +1284,7 @@ zaptemp (char const *name)
+@@ -1214,7 +1283,7 @@ zaptemp (char const *name)
    free (node);
  }
  
@@ -2560,7 +2580,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  
  static int
  struct_month_cmp (void const *m1, void const *m2)
-@@ -1230,7 +1299,7 @@ struct_month_cmp (void const *m1, void c
+@@ -1229,7 +1298,7 @@ struct_month_cmp (void const *m1, void c
  /* Initialize the character class tables. */
  
  static void
@@ -2569,7 +2589,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  {
    size_t i;
  
-@@ -1242,7 +1311,7 @@ inittables (void)
+@@ -1241,7 +1310,7 @@ inittables (void)
        fold_toupper[i] = toupper (i);
      }
  
@@ -2578,7 +2598,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
    /* If we're not in the "C" locale, read different names for months.  */
    if (hard_LC_TIME)
      {
-@@ -1324,6 +1393,84 @@ specify_nmerge (int oi, char c, char con
+@@ -1323,6 +1392,84 @@ specify_nmerge (int oi, char c, char con
      xstrtol_fatal (e, oi, c, long_options, s);
  }
  
@@ -2663,7 +2683,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/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)
-@@ -1552,7 +1699,7 @@ buffer_linelim (struct buffer const *buf
+@@ -1551,7 +1698,7 @@ buffer_linelim (struct buffer const *buf
     by KEY in LINE. */
  
  static char *
@@ -2672,7 +2692,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  {
    char *ptr = line->text, *lim = ptr + line->length - 1;
    size_t sword = key->sword;
-@@ -1561,10 +1708,10 @@ begfield (struct line const *line, struc
+@@ -1560,10 +1707,10 @@ begfield (struct line const *line, struc
    /* The leading field separator itself is included in a field when -t
       is absent.  */
  
@@ -2685,7 +2705,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
            ++ptr;
          if (ptr < lim)
            ++ptr;
-@@ -1590,11 +1737,70 @@ begfield (struct line const *line, struc
+@@ -1589,11 +1736,70 @@ begfield (struct line const *line, struc
    return ptr;
  }
  
@@ -2757,9 +2777,9 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  {
    char *ptr = line->text, *lim = ptr + line->length - 1;
    size_t eword = key->eword, echar = key->echar;
-@@ -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
+@@ -1608,10 +1814,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.  */
 -  if (tab != TAB_DEFAULT)
 +  if (tab_length)
@@ -2770,7 +2790,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
            ++ptr;
          if (ptr < lim && (eword || echar))
            ++ptr;
-@@ -1658,10 +1864,10 @@ limfield (struct line const *line, struc
+@@ -1657,10 +1863,10 @@ limfield (struct line const *line, struc
       */
  
    /* Make LIM point to the end of (one byte past) the current field.  */
@@ -2783,7 +2803,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
        if (newlim)
          lim = newlim;
      }
-@@ -1692,6 +1898,130 @@ limfield (struct line const *line, struc
+@@ -1691,6 +1897,130 @@ limfield (struct line const *line, struc
    return ptr;
  }
  
@@ -2914,7 +2934,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/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
-@@ -1778,8 +2108,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
+@@ -1777,8 +2107,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
                    else
                      {
                        if (key->skipsblanks)
@@ -2939,7 +2959,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
                        line->keybeg = line_start;
                      }
                  }
-@@ -1900,7 +2244,7 @@ human_numcompare (char const *a, char co
+@@ -1899,7 +2243,7 @@ human_numcompare (char const *a, char co
     hideously fast. */
  
  static int
@@ -2948,7 +2968,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  {
    while (blanks[to_uchar (*a)])
      a++;
-@@ -1910,6 +2254,25 @@ numcompare (char const *a, char const *b
+@@ -1909,6 +2253,25 @@ numcompare (char const *a, char const *b
    return strnumcmp (a, b, decimal_point, thousands_sep);
  }
  
@@ -2974,7 +2994,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/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
-@@ -1942,7 +2305,7 @@ general_numcompare (char const *sa, char
+@@ -1959,7 +2322,7 @@ general_numcompare (char const *sa, char
     Return 0 if the name in S is not recognized.  */
  
  static int
@@ -2983,7 +3003,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  {
    size_t lo = 0;
    size_t hi = MONTHS_PER_YEAR;
-@@ -2217,15 +2580,14 @@ debug_key (struct line const *line, stru
+@@ -2234,15 +2597,14 @@ debug_key (struct line const *line, stru
            char saved = *lim;
            *lim = '\0';
  
@@ -3001,7 +3021,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
            else if (key->general_numeric)
              ignore_value (strtold (beg, &tighter_lim));
            else if (key->numeric || key->human_numeric)
-@@ -2369,7 +2731,7 @@ key_warnings (struct keyfield const *gke
+@@ -2386,7 +2748,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  */
@@ -3010,8 +3030,8 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
            && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
                || (!key->skipsblanks && key->schar)
                || (!key->skipeblanks && key->echar)))
-@@ -2427,11 +2789,83 @@ key_warnings (struct keyfield const *gke
-     error (0, 0, _("option `-r' only applies to last-resort comparison"));
+@@ -2444,11 +2806,83 @@ key_warnings (struct keyfield const *gke
+     error (0, 0, _("option '-r' only applies to last-resort comparison"));
  }
  
 +#if HAVE_MBRTOWC
@@ -3076,12 +3096,12 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
 +    }
 +  while (hi - lo > 1);
 +
-+  if (ea)
-+     *ea = (char *) month;
-+
 +  result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
 +      ? monthtab[lo].val : 0);
 +
++  if (ea && result)
++     *ea = s + strlen (monthtab[lo].name);
++
 +  return result;
 +}
 +#endif
@@ -3095,7 +3115,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
  {
    struct keyfield *key = keylist;
  
-@@ -2516,7 +2950,7 @@ keycompare (struct line const *a, struct
+@@ -2533,7 +2967,7 @@ keycompare (struct line const *a, struct
            else if (key->human_numeric)
              diff = human_numcompare (ta, tb);
            else if (key->month)
@@ -3104,7 +3124,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
            else if (key->random)
              diff = compare_random (ta, tlena, tb, tlenb);
            else if (key->version)
-@@ -2632,6 +3066,180 @@ keycompare (struct line const *a, struct
+@@ -2649,6 +3083,180 @@ keycompare (struct line const *a, struct
    return key->reverse ? -diff : diff;
  }
  
@@ -3285,7 +3305,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/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. */
  
-@@ -4095,7 +4702,7 @@ main (int argc, char **argv)
+@@ -4109,7 +4717,7 @@ main (int argc, char **argv)
    initialize_exit_failure (SORT_FAILURE);
  
    hard_LC_COLLATE = hard_locale (LC_COLLATE);
@@ -3294,7 +3314,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
    hard_LC_TIME = hard_locale (LC_TIME);
  #endif
  
-@@ -4116,6 +4723,29 @@ main (int argc, char **argv)
+@@ -4130,6 +4738,29 @@ main (int argc, char **argv)
        thousands_sep = -1;
    }
  
@@ -3324,7 +3344,7 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
    have_read_stdin = false;
    inittables ();
  
-@@ -4386,13 +5016,34 @@ main (int argc, char **argv)
+@@ -4400,13 +5031,34 @@ main (int argc, char **argv)
  
          case 't':
            {
@@ -3362,8 +3382,8 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
 +                  newtab[0] = '\0';
                  else
                    {
-                     /* Provoke with `sort -txx'.  Complain about
-@@ -4403,9 +5054,12 @@ main (int argc, char **argv)
+                     /* Provoke with 'sort -txx'.  Complain about
+@@ -4417,9 +5069,12 @@ main (int argc, char **argv)
                             quote (optarg));
                    }
                }
@@ -3378,10 +3398,10 @@ diff -urNp coreutils-8.13-orig/src/sort.c coreutils-8.13/src/sort.c
            }
            break;
  
-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 @@
+diff -urNp coreutils-8.16-orig/src/unexpand.c coreutils-8.16/src/unexpand.c
+--- coreutils-8.16-orig/src/unexpand.c 2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/unexpand.c      2012-03-26 17:51:46.000000000 +0200
+@@ -38,12 +38,29 @@
  #include <stdio.h>
  #include <getopt.h>
  #include <sys/types.h>
@@ -3408,10 +3428,10 @@ diff -urNp coreutils-8.13-orig/src/unexpand.c coreutils-8.13/src/unexpand.c
 +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
 +#endif
 +
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
  #define PROGRAM_NAME "unexpand"
  
-@@ -104,6 +121,208 @@ static struct option const longopts[] =
+@@ -103,6 +120,208 @@ static struct option const longopts[] =
    {NULL, 0, NULL, 0}
  };
  
@@ -3620,7 +3640,7 @@ diff -urNp coreutils-8.13-orig/src/unexpand.c coreutils-8.13/src/unexpand.c
  void
  usage (int status)
  {
-@@ -526,7 +745,12 @@ main (int argc, char **argv)
+@@ -524,7 +743,12 @@ main (int argc, char **argv)
  
    file_list = (optind < argc ? &argv[optind] : stdin_argv);
  
@@ -3634,9 +3654,9 @@ diff -urNp coreutils-8.13-orig/src/unexpand.c coreutils-8.13/src/unexpand.c
  
    if (have_read_stdin && fclose (stdin) != 0)
      error (EXIT_FAILURE, errno, "-");
-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
+diff -urNp coreutils-8.16-orig/src/uniq.c coreutils-8.16/src/uniq.c
+--- coreutils-8.16-orig/src/uniq.c     2012-03-24 21:26:51.000000000 +0100
++++ coreutils-8.16/src/uniq.c  2012-03-26 17:35:09.000000000 +0200
 @@ -21,6 +21,16 @@
  #include <getopt.h>
  #include <sys/types.h>
@@ -3673,7 +3693,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
 +#endif
 +
  
- /* The official name of this program (e.g., no `g' prefix).  */
+ /* The official name of this program (e.g., no 'g' prefix).  */
  #define PROGRAM_NAME "uniq"
 @@ -108,6 +130,10 @@ static enum delimit_method const delimit
  /* Select whether/how to delimit groups of duplicate lines.  */
@@ -3686,7 +3706,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
  static struct option const longopts[] =
  {
    {"count", no_argument, NULL, 'c'},
-@@ -207,7 +233,7 @@ size_opt (char const *opt, char const *m
+@@ -206,7 +232,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 * _GL_ATTRIBUTE_PURE
@@ -3695,7 +3715,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
  {
    size_t count;
    char const *lp = line->buffer;
-@@ -227,6 +253,83 @@ find_field (struct linebuffer const *lin
+@@ -226,6 +252,83 @@ find_field (struct linebuffer const *lin
    return line->buffer + i;
  }
  
@@ -3779,7 +3799,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/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.
-@@ -235,6 +338,8 @@ find_field (struct linebuffer const *lin
+@@ -234,6 +337,8 @@ find_field (struct linebuffer const *lin
  static bool
  different (char *old, char *new, size_t oldlen, size_t newlen)
  {
@@ -3788,7 +3808,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
    if (check_chars < oldlen)
      oldlen = check_chars;
    if (check_chars < newlen)
-@@ -242,14 +347,92 @@ different (char *old, char *new, size_t 
+@@ -241,14 +346,92 @@ different (char *old, char *new, size_t 
  
    if (ignore_case)
      {
@@ -3886,7 +3906,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
  
  /* Output the line in linebuffer LINE to standard output
     provided that the switches say it should be output.
-@@ -305,15 +488,43 @@ check_file (const char *infile, const ch
+@@ -304,15 +487,43 @@ check_file (const char *infile, const ch
      {
        char *prevfield IF_LINT ( = NULL);
        size_t prevlen IF_LINT ( = 0);
@@ -3930,7 +3950,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
            if (prevline->length == 0
                || different (thisfield, prevfield, thislen, prevlen))
              {
-@@ -332,17 +543,26 @@ check_file (const char *infile, const ch
+@@ -331,17 +542,26 @@ check_file (const char *infile, const ch
        size_t prevlen;
        uintmax_t match_count = 0;
        bool first_delimiter = true;
@@ -3957,7 +3977,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
            if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
              {
                if (ferror (stdin))
-@@ -351,6 +571,14 @@ check_file (const char *infile, const ch
+@@ -350,6 +570,14 @@ check_file (const char *infile, const ch
              }
            thisfield = find_field (thisline);
            thislen = thisline->length - 1 - (thisfield - thisline->buffer);
@@ -3972,7 +3992,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
            match = !different (thisfield, prevfield, thislen, prevlen);
            match_count += match;
  
-@@ -383,6 +611,9 @@ check_file (const char *infile, const ch
+@@ -382,6 +610,9 @@ check_file (const char *infile, const ch
                SWAP_LINES (prevline, thisline);
                prevfield = thisfield;
                prevlen = thislen;
@@ -3982,7 +4002,7 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
                if (!match)
                  match_count = 0;
              }
-@@ -428,6 +659,19 @@ main (int argc, char **argv)
+@@ -427,6 +658,19 @@ main (int argc, char **argv)
  
    atexit (close_stdout);
  
@@ -4002,18 +4022,18 @@ diff -urNp coreutils-8.13-orig/src/uniq.c coreutils-8.13/src/uniq.c
    skip_chars = 0;
    skip_fields = 0;
    check_chars = SIZE_MAX;
-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                                \
+diff -urNp coreutils-8.16-orig/tests/Makefile.am coreutils-8.16/tests/Makefile.am
+--- coreutils-8.16-orig/tests/Makefile.am      2012-03-26 18:01:35.564014659 +0200
++++ coreutils-8.16/tests/Makefile.am   2012-03-26 18:02:01.023015013 +0200
+@@ -242,6 +242,7 @@ TESTS =                                            \
    misc/sort-debug-warn                                \
+   misc/sort-discrim                           \
    misc/sort-files0-from                               \
 +  misc/sort-mb-tests                          \
    misc/sort-float                             \
    misc/sort-merge                             \
    misc/sort-merge-fdlimit                     \
-@@ -518,6 +519,10 @@ TESTS =                                           \
+@@ -537,6 +538,10 @@ TESTS =                                           \
    $(root_tests)
  
  pr_data =                                     \
@@ -4024,10 +4044,10 @@ diff -urNp coreutils-8.13-orig/tests/Makefile.am coreutils-8.13/tests/Makefile.a
    pr/0F                                               \
    pr/0FF                                      \
    pr/0FFnt                                    \
-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};
+diff -urNp coreutils-8.16-orig/tests/misc/cut coreutils-8.16/tests/misc/cut
+--- coreutils-8.16-orig/tests/misc/cut 2012-02-03 10:22:06.000000000 +0100
++++ coreutils-8.16/tests/misc/cut      2012-03-26 17:40:49.000000000 +0200
+@@ -23,14 +23,15 @@ use strict;
  # Turn off localization of executable's output.
  @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
  
@@ -4040,14 +4060,14 @@ diff -urNp coreutils-8.13-orig/tests/misc/cut coreutils-8.13/tests/misc/cut
 +my $mb_locale = 'C';
  
  my $prog = 'cut';
- my $try = "Try \`$prog --help' for more information.\n";
+ my $try = "Try '$prog --help' for more information.\n";
  my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
 -my $inval = "$prog: invalid byte or field list\n$try";
 +my $inval = "$prog: invalid byte, character or field list\n$try";
  my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";
  
  my @Tests =
-@@ -147,7 +147,7 @@ my @Tests =
+@@ -147,7 +148,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},
@@ -4056,41 +4076,41 @@ diff -urNp coreutils-8.13-orig/tests/misc/cut coreutils-8.13/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.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
+diff -urNp coreutils-8.16-orig/tests/misc/mb1.I coreutils-8.16/tests/misc/mb1.I
+--- coreutils-8.16-orig/tests/misc/mb1.I       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.16/tests/misc/mb1.I    2012-03-26 17:35:09.000000000 +0200
 @@ -0,0 +1,4 @@
 +Apple@10
 +Banana@5
 +Citrus@20
 +Cherry@30
-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
+diff -urNp coreutils-8.16-orig/tests/misc/mb1.X coreutils-8.16/tests/misc/mb1.X
+--- coreutils-8.16-orig/tests/misc/mb1.X       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.16/tests/misc/mb1.X    2012-03-26 17:35:09.000000000 +0200
 @@ -0,0 +1,4 @@
 +Banana@5
 +Apple@10
 +Citrus@20
 +Cherry@30
-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
+diff -urNp coreutils-8.16-orig/tests/misc/mb2.I coreutils-8.16/tests/misc/mb2.I
+--- coreutils-8.16-orig/tests/misc/mb2.I       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.16/tests/misc/mb2.I    2012-03-26 17:35:09.000000000 +0200
 @@ -0,0 +1,4 @@
 +Apple@AA10@@20
 +Banana@AA5@@30
 +Citrus@AA20@@5
 +Cherry@AA30@@10
-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
+diff -urNp coreutils-8.16-orig/tests/misc/mb2.X coreutils-8.16/tests/misc/mb2.X
+--- coreutils-8.16-orig/tests/misc/mb2.X       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.16/tests/misc/mb2.X    2012-03-26 17:35:09.000000000 +0200
 @@ -0,0 +1,4 @@
 +Citrus@AA20@@5
 +Cherry@AA30@@10
 +Apple@AA10@@20
 +Banana@AA5@@30
-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
+diff -urNp coreutils-8.16-orig/tests/misc/sort-mb-tests coreutils-8.16/tests/misc/sort-mb-tests
+--- coreutils-8.16-orig/tests/misc/sort-mb-tests       1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.16/tests/misc/sort-mb-tests    2012-03-26 17:35:09.000000000 +0200
 @@ -0,0 +1,58 @@
 +#! /bin/sh
 +case $# in
index 3e5c143df72b46baff710805f7fb7fd79ae34db0..0db3acbcd61dc80cbd72757a1cbd4245ce628371 100644 (file)
@@ -392,7 +392,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
        || format_needs_stat
 @@ -2869,7 +2896,7 @@ gobble_file (char const *name, enum file
            && print_with_color && is_colored (C_CAP))
-         f->has_capability = has_capability (absolute_name);
+         f->has_capability = has_capability_cache (absolute_name, f);
  
 -      if (format == long_format || print_scontext)
 +      if (format == long_format || format == security_format || print_scontext)
@@ -406,7 +406,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
 -          if (err == 0 && format == long_format)
 +          if (err == 0 && (format == long_format || format == security_format))
              {
-               int n = file_has_acl (absolute_name, &f->stat);
+               int n = file_has_acl_cache (absolute_name, f);
                err = (n < 0);
 @@ -2911,7 +2938,8 @@ gobble_file (char const *name, enum file
          }