From: Michael Tremer Date: Tue, 4 May 2010 12:16:25 +0000 (+0200) Subject: toolchain: Update of coreutils' patches. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fe6dda9e780daa3b32ef906a1c6f1acff0d792c;p=ipfire-3.x.git toolchain: Update of coreutils' patches. --- diff --git a/pkgs/toolchain/coreutils/patches/coreutils-7.6-uname_PIC-1.patch b/pkgs/toolchain/coreutils/patches/coreutils-7.6-uname_PIC-1.patch deleted file mode 100644 index 0ae413fb1..000000000 --- a/pkgs/toolchain/coreutils/patches/coreutils-7.6-uname_PIC-1.patch +++ /dev/null @@ -1,204 +0,0 @@ -Submitted By: Robert Connolly (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 - #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 /* 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 diff --git a/pkgs/toolchain/coreutils/patches/coreutils-8.4-upstream-cp-mv-enotsup-xattr-test.patch b/pkgs/toolchain/coreutils/patches/coreutils-8.4-upstream-cp-mv-enotsup-xattr-test.patch deleted file mode 100644 index 1a54ba910..000000000 --- a/pkgs/toolchain/coreutils/patches/coreutils-8.4-upstream-cp-mv-enotsup-xattr-test.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 9c566ad04a3b6b7672ab10cacea23d9f6a599c0e Mon Sep 17 00:00:00 2001 -From: Pádraig Brady -Date: Sat, 23 Jan 2010 23:35:41 +0000 -Subject: tests: make cp-mv-enotsup-xattr independent of the host file system - -* tests/cp-mv-enotsup-xattr: Create a file system from which to copy -the xattrs so that the test is not skipped if the host file system -does not have user_xattr support. Also don't erroneously fail when -built without xattr support. ---- -diff --git a/tests/cp/cp-mv-enotsup-xattr b/tests/cp/cp-mv-enotsup-xattr -index 45f86f7..0239abb 100755 ---- a/tests/cp/cp-mv-enotsup-xattr -+++ b/tests/cp/cp-mv-enotsup-xattr -@@ -28,65 +28,81 @@ fi - require_root_ - - cwd=`pwd` --cleanup_() { cd /; umount "$cwd/mnt"; } -+cleanup_() { cd /; umount "$cwd/noxattr"; umount "$cwd/xattr"; } - - skip=0 --# Create a file system without user xattr support, then mount it. --dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \ -- || skip=1 --mkdir mnt || skip=1 --mkfs -t ext2 -F blob || -- skip_test_ "failed to create ext2 file system" - --mount -oloop,nouser_xattr blob mnt || skip=1 --echo test > mnt/f || skip=1 --test -s mnt/f || skip=1 -+# Mount an ext2 loopback file system at $WHERE with $OPTS -+make_fs() { -+ where="$1" -+ opts="$2" - --test $skip = 1 \ -- && skip_test_ "insufficient mount/ext2 support" -+ fs="$where.bin" -+ -+ dd if=/dev/zero of="$fs" bs=8192 count=200 > /dev/null 2>&1 \ -+ || skip=1 -+ mkdir "$where" || skip=1 -+ mkfs -t ext2 -F "$fs" || -+ skip_test_ "failed to create ext2 file system" -+ mount -oloop,$opts "$fs" "$where" || skip=1 -+ echo test > "$where"/f || skip=1 -+ test -s "$where"/f || skip=1 -+ -+ test $skip = 1 && -+ skip_test_ "insufficient mount/ext2 support" -+} -+ -+make_fs noxattr nouser_xattr -+make_fs xattr user_xattr - - # testing xattr name-value pair - xattr_name="user.foo" - xattr_value="bar" - xattr_pair="$xattr_name=\"$xattr_value\"" - --echo test > a || framework_failure --getfattr -d a >out_a || skip_test_ "failed to get xattr of file" -+echo test > xattr/a || framework_failure -+getfattr -d xattr/a >out_a || skip_test_ "failed to get xattr of file" - grep -F "$xattr_pair" out_a >/dev/null && framework_failure --setfattr -n "$xattr_name" -v "$xattr_value" a >out_a \ -+setfattr -n "$xattr_name" -v "$xattr_value" xattr/a >out_a \ - || skip_test_ "failed to set xattr of file" --getfattr -d a >out_a || skip_test_ "failed to get xattr of file" -+getfattr -d xattr/a >out_a || skip_test_ "failed to get xattr of file" - grep -F "$xattr_pair" out_a >/dev/null \ - || skip_test_ "failed to set xattr of file" - - - # This should pass without diagnostics --cp -a a mnt/ 2>err || fail=1 --test -s mnt/a || fail=1 # destination file must not be empty -+cp -a xattr/a noxattr/ 2>err || fail=1 -+test -s noxattr/a || fail=1 # destination file must not be empty - test -s err && fail=1 # there must be no stderr output - --rm -f err mnt/a -+rm -f err noxattr/a - - # This should pass without diagnostics --cp --preserve=all a mnt/ 2>err || fail=1 --test -s mnt/a || fail=1 # destination file must not be empty -+cp --preserve=all xattr/a noxattr/ 2>err || fail=1 -+test -s noxattr/a || fail=1 # destination file must not be empty - test -s err && fail=1 # there must be no stderr output - --rm -f err mnt/a -+rm -f err noxattr/a - - # This should fail with coresponding diagnostics --cp -a --preserve=xattr a mnt/ 2>err && fail=1 --cat <<\EOF > exp || fail=1 --cp: setting attributes for `mnt/a': Operation not supported -+cp -a --preserve=xattr xattr/a noxattr/ 2>err && fail=1 -+if grep '^#define USE_XATTR 1' $CONFIG_HEADER > /dev/null; then -+cat <<\EOF > exp -+cp: setting attributes for `noxattr/a': Operation not supported - EOF -+else -+cat <<\EOF > exp -+cp: cannot preserve extended attributes, cp is built without xattr support -+EOF -+fi - - compare err exp || fail=1 - --rm -f err mnt/a -+rm -f err noxattr/a - - # This should pass without diagnostics --mv a mnt/ 2>err || fail=1 --test -s mnt/a || fail=1 # destination file must not be empty --test -s err && fail=1 # there must be no stderr output -+mv xattr/a noxattr/ 2>err || fail=1 -+test -s noxattr/a || fail=1 # destination file must not be empty -+test -s err && fail=1 # there must be no stderr output - - Exit $fail --- -cgit v0.8.2.1 diff --git a/pkgs/toolchain/coreutils/patches/coreutils-8.4-upstream-xattr.patch b/pkgs/toolchain/coreutils/patches/coreutils-8.4-upstream-xattr.patch deleted file mode 100644 index 0c876505b..000000000 --- a/pkgs/toolchain/coreutils/patches/coreutils-8.4-upstream-xattr.patch +++ /dev/null @@ -1,48 +0,0 @@ -From e489fd04d66000829f5458843970794eccacced8 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Sat, 16 Jan 2010 13:46:17 +0000 -Subject: build: fix failure from bogus USE_XATTR definition - -* m4/xattr.m4 (gl_FUNC_ADDR): Fix regression introduced in commit -6beca4248. -* THANKS: Update. -Reported by Adam Sampson. ---- -diff --git a/THANKS b/THANKS -index 583ea60..1207368 100644 ---- a/THANKS -+++ b/THANKS -@@ -12,6 +12,7 @@ Aaron Hawley ashawley@uvm.edu - Achim Blumensath blume@corona.oche.de - Adam Jimerson vendion@charter.net - Adam Klein aklein@debian.org -+Adam Sampson ats@offog.org - Adrian Bunk bunk@stusta.de - AIDA Shinra shinra@j10n.org - Akim Demaille demaille@inf.enst.fr -diff --git a/m4/xattr.m4 b/m4/xattr.m4 -index bf7e872..80fddbd 100644 ---- a/m4/xattr.m4 -+++ b/m4/xattr.m4 -@@ -1,4 +1,5 @@ - # xattr.m4 - check for Extended Attributes (Linux) -+# serial 3 - - # Copyright (C) 2003, 2008-2010 Free Software Foundation, Inc. - # This file is free software; the Free Software Foundation -@@ -33,11 +34,11 @@ AC_DEFUN([gl_FUNC_XATTR], - use_xattr=yes - fi - fi -- AC_DEFINE_UNQUOTED([USE_XATTR], [$use_xattr], -- [Define if you want extended attribute support.]) - if test $use_xattr = no; then - AC_MSG_WARN([libattr development library was not found or not usable.]) - AC_MSG_WARN([AC_PACKAGE_NAME will be built without xattr support.]) - fi - fi -+ AC_DEFINE_UNQUOTED([USE_XATTR], [`test $use_xattr != yes; echo $?`], -+ [Define if you want extended attribute support.]) - ]) --- -cgit v0.8.2.1 diff --git a/pkgs/toolchain/coreutils/patches/coreutils-8.4-i18n.patch b/pkgs/toolchain/coreutils/patches/coreutils-8.5-i18n.patch similarity index 95% rename from pkgs/toolchain/coreutils/patches/coreutils-8.4-i18n.patch rename to pkgs/toolchain/coreutils/patches/coreutils-8.5-i18n.patch index a8faefe27..d6e6c4677 100644 --- a/pkgs/toolchain/coreutils/patches/coreutils-8.4-i18n.patch +++ b/pkgs/toolchain/coreutils/patches/coreutils-8.5-i18n.patch @@ -1,6 +1,6 @@ -diff -urNp coreutils-8.0-orig/lib/linebuffer.h coreutils-8.0/lib/linebuffer.h ---- coreutils-8.0-orig/lib/linebuffer.h 2009-10-06 10:59:48.000000000 +0200 -+++ coreutils-8.0/lib/linebuffer.h 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/lib/linebuffer.h coreutils-8.5/lib/linebuffer.h +--- coreutils-8.5-orig/lib/linebuffer.h 2010-04-23 15:44:00.000000000 +0200 ++++ coreutils-8.5/lib/linebuffer.h 2010-04-26 14:24:33.000000000 +0200 @@ -21,6 +21,11 @@ # include @@ -23,9 +23,9 @@ diff -urNp coreutils-8.0-orig/lib/linebuffer.h coreutils-8.0/lib/linebuffer.h }; /* Initialize linebuffer LINEBUFFER for use. */ -diff -urNp coreutils-8.0-orig/src/cut.c coreutils-8.0/src/cut.c ---- coreutils-8.0-orig/src/cut.c 2009-09-23 10:25:44.000000000 +0200 -+++ coreutils-8.0/src/cut.c 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/src/cut.c coreutils-8.5/src/cut.c +--- coreutils-8.5-orig/src/cut.c 2010-04-20 21:52:04.000000000 +0200 ++++ coreutils-8.5/src/cut.c 2010-04-26 14:24:33.000000000 +0200 @@ -28,6 +28,11 @@ #include #include @@ -489,7 +489,7 @@ diff -urNp coreutils-8.0-orig/src/cut.c coreutils-8.0/src/cut.c @@ -757,6 +1075,8 @@ main (int argc, char **argv) bool ok; bool delim_specified = false; - char *spec_list_string IF_LINT(= NULL); + char *spec_list_string IF_LINT (= NULL); + char mbdelim[MB_LEN_MAX + 1]; + size_t delimlen = 0; @@ -616,10 +616,10 @@ diff -urNp coreutils-8.0-orig/src/cut.c coreutils-8.0/src/cut.c } if (optind == argc) -diff -urNp coreutils-8.0-orig/src/expand.c coreutils-8.0/src/expand.c ---- coreutils-8.0-orig/src/expand.c 2009-09-29 15:27:54.000000000 +0200 -+++ coreutils-8.0/src/expand.c 2009-10-07 10:07:16.000000000 +0200 -@@ -37,11 +37,28 @@ +diff -urNp coreutils-8.5-orig/src/expand.c coreutils-8.5/src/expand.c +--- coreutils-8.5-orig/src/expand.c 2010-01-01 14:06:47.000000000 +0100 ++++ coreutils-8.5/src/expand.c 2010-04-26 14:24:33.000000000 +0200 +@@ -38,11 +38,28 @@ #include #include #include @@ -648,7 +648,7 @@ diff -urNp coreutils-8.0-orig/src/expand.c coreutils-8.0/src/expand.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "expand" -@@ -357,6 +374,142 @@ expand (void) +@@ -358,6 +375,142 @@ expand (void) } } @@ -791,7 +791,7 @@ diff -urNp coreutils-8.0-orig/src/expand.c coreutils-8.0/src/expand.c int main (int argc, char **argv) { -@@ -421,7 +574,12 @@ main (int argc, char **argv) +@@ -422,7 +575,12 @@ main (int argc, char **argv) file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -805,9 +805,9 @@ diff -urNp coreutils-8.0-orig/src/expand.c coreutils-8.0/src/expand.c if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); -diff -urNp coreutils-8.0-orig/src/fold.c coreutils-8.0/src/fold.c ---- coreutils-8.0-orig/src/fold.c 2009-09-23 10:25:44.000000000 +0200 -+++ coreutils-8.0/src/fold.c 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/src/fold.c coreutils-8.5/src/fold.c +--- coreutils-8.5-orig/src/fold.c 2010-01-01 14:06:47.000000000 +0100 ++++ coreutils-8.5/src/fold.c 2010-04-26 14:24:33.000000000 +0200 @@ -22,11 +22,33 @@ #include #include @@ -1205,9 +1205,9 @@ diff -urNp coreutils-8.0-orig/src/fold.c coreutils-8.0/src/fold.c break; case 's': /* Break at word boundaries. */ -diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c ---- coreutils-8.0-orig/src/join.c 2009-09-23 10:25:44.000000000 +0200 -+++ coreutils-8.0/src/join.c 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/src/join.c coreutils-8.5/src/join.c +--- coreutils-8.5-orig/src/join.c 2010-04-20 21:52:04.000000000 +0200 ++++ coreutils-8.5/src/join.c 2010-04-26 14:24:33.000000000 +0200 @@ -22,17 +22,31 @@ #include #include @@ -1258,7 +1258,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c /* If nonzero, check that the input is correctly ordered. */ static enum -@@ -239,10 +255,11 @@ xfields (struct line *line) +@@ -248,10 +264,11 @@ xfields (struct line *line) if (ptr == lim) return; @@ -1272,7 +1272,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c extract_field (line, ptr, sep - ptr); } else -@@ -269,6 +286,148 @@ xfields (struct line *line) +@@ -278,6 +295,148 @@ xfields (struct line *line) extract_field (line, ptr, lim - ptr); } @@ -1421,7 +1421,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c static void freeline (struct line *line) { -@@ -287,56 +446,115 @@ keycmp (struct line const *line1, struct +@@ -299,56 +458,115 @@ keycmp (struct line const *line1, struct size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -1560,7 +1560,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c } /* Check that successive input lines PREV and CURRENT from input file -@@ -417,6 +635,11 @@ get_line (FILE *fp, struct line **linep, +@@ -429,6 +647,11 @@ get_line (FILE *fp, struct line **linep, return false; } @@ -1572,7 +1572,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c xfields (line); if (prevline[which - 1]) -@@ -518,11 +741,18 @@ prfield (size_t n, struct line const *li +@@ -528,11 +751,18 @@ prfield (size_t n, struct line const *li /* Print the join of LINE1 and LINE2. */ @@ -1592,7 +1592,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c outlist = outlist_head.next; if (outlist) -@@ -557,7 +787,7 @@ prjoin (struct line const *line1, struct +@@ -567,7 +797,7 @@ prjoin (struct line const *line1, struct o = o->next; if (o == NULL) break; @@ -1601,7 +1601,7 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c } putchar ('\n'); } -@@ -575,23 +805,23 @@ prjoin (struct line const *line1, struct +@@ -585,23 +815,23 @@ prjoin (struct line const *line1, struct prfield (join_field_1, line1); for (i = 0; i < join_field_1 && i < line1->nfields; ++i) { @@ -1629,17 +1629,13 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c prfield (i, line2); } putchar ('\n'); -@@ -1022,20 +1252,41 @@ main (int argc, char **argv) +@@ -1039,21 +1269,46 @@ main (int argc, char **argv) case 't': { - unsigned char newtab = optarg[0]; -- if (! newtab) + char *newtab; + size_t newtablen; -+ if (! optarg[0]) - error (EXIT_FAILURE, 0, _("empty tab")); -- if (optarg[1]) + newtab = xstrdup (optarg); +#if HAVE_MBRTOWC + if (MB_CUR_MAX > 1) @@ -1658,32 +1654,40 @@ diff -urNp coreutils-8.0-orig/src/join.c coreutils-8.0/src/join.c + else +#endif + newtablen = 1; -+ -+ if (newtablen == 1 && newtab[1]) -+ { -+ if (STREQ (newtab, "\\0")) -+ newtab[0] = '\0'; -+ } -+ if (tab != NULL && strcmp (tab, newtab)) + if (! newtab) ++ { + newtab = '\n'; /* '' => process the whole line. */ ++ } + else if (optarg[1]) { - if (STREQ (optarg, "\\0")) - newtab = '\0'; - else - error (EXIT_FAILURE, 0, _("multi-character tab %s"), - quote (optarg)); ++ if (newtablen == 1 && newtab[1]) ++ { ++ if (STREQ (newtab, "\\0")) ++ newtab[0] = '\0'; ++ } ++ } ++ if (tab != NULL && strcmp (tab, newtab)) ++ { + free (newtab); + error (EXIT_FAILURE, 0, _("incompatible tabs")); } - if (0 <= tab && tab != newtab) - error (EXIT_FAILURE, 0, _("incompatible tabs")); tab = newtab; +- } + tablen = newtablen; - } ++ } break; -diff -urNp coreutils-8.0-orig/src/pr.c coreutils-8.0/src/pr.c ---- coreutils-8.0-orig/src/pr.c 2009-09-29 15:27:54.000000000 +0200 -+++ coreutils-8.0/src/pr.c 2009-10-07 10:07:16.000000000 +0200 + case NOCHECK_ORDER_OPTION: +diff -urNp coreutils-8.5-orig/src/pr.c coreutils-8.5/src/pr.c +--- coreutils-8.5-orig/src/pr.c 2010-03-13 16:14:09.000000000 +0100 ++++ coreutils-8.5/src/pr.c 2010-04-26 14:24:33.000000000 +0200 @@ -312,6 +312,32 @@ #include @@ -2406,9 +2410,9 @@ diff -urNp coreutils-8.0-orig/src/pr.c coreutils-8.0/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.0-orig/src/sort.c coreutils-8.0/src/sort.c ---- coreutils-8.0-orig/src/sort.c 2009-09-29 15:27:54.000000000 +0200 -+++ coreutils-8.0/src/sort.c 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/src/sort.c coreutils-8.5/src/sort.c +--- coreutils-8.5-orig/src/sort.c 2010-04-21 09:06:17.000000000 +0200 ++++ coreutils-8.5/src/sort.c 2010-04-26 14:24:33.000000000 +0200 @@ -22,10 +22,19 @@ #include @@ -2429,7 +2433,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c #include "system.h" #include "argmatch.h" #include "error.h" -@@ -122,14 +131,38 @@ static int decimal_point; +@@ -124,14 +133,38 @@ static int decimal_point; /* Thousands separator; if -1, then there isn't one. */ static int thousands_sep; @@ -2469,7 +2473,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both }; -@@ -268,13 +301,11 @@ static bool reverse; +@@ -270,13 +303,11 @@ static bool reverse; they were read if all keys compare equal. */ static bool stable; @@ -2486,7 +2490,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -712,6 +743,44 @@ reap_some (void) +@@ -714,6 +745,44 @@ reap_some (void) update_proc (pid); } @@ -2531,7 +2535,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c /* Clean up any remaining temporary files. */ static void -@@ -1093,7 +1162,7 @@ zaptemp (const char *name) +@@ -1158,7 +1227,7 @@ zaptemp (const char *name) free (node); } @@ -2540,7 +2544,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c static int struct_month_cmp (const void *m1, const void *m2) -@@ -1108,7 +1177,7 @@ struct_month_cmp (const void *m1, const +@@ -1173,7 +1242,7 @@ struct_month_cmp (const void *m1, const /* Initialize the character class tables. */ static void @@ -2549,7 +2553,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c { size_t i; -@@ -1120,7 +1189,7 @@ inittables (void) +@@ -1185,7 +1254,7 @@ inittables (void) fold_toupper[i] = toupper (i); } @@ -2558,7 +2562,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1202,6 +1271,64 @@ specify_nmerge (int oi, char c, char con +@@ -1268,6 +1337,64 @@ specify_nmerge (int oi, char c, char con xstrtol_fatal (e, oi, c, long_options, s); } @@ -2623,7 +2627,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/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) -@@ -1412,7 +1539,7 @@ buffer_linelim (struct buffer const *buf +@@ -1478,7 +1605,7 @@ buffer_linelim (struct buffer const *buf by KEY in LINE. */ static char * @@ -2632,7 +2636,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1421,10 +1548,10 @@ begfield (const struct line *line, const +@@ -1487,10 +1614,10 @@ begfield (const struct line *line, const /* The leading field separator itself is included in a field when -t is absent. */ @@ -2645,7 +2649,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c ++ptr; if (ptr < lim) ++ptr; -@@ -1450,11 +1577,70 @@ begfield (const struct line *line, const +@@ -1516,11 +1643,70 @@ begfield (const struct line *line, const return ptr; } @@ -2717,7 +2721,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1469,10 +1655,10 @@ limfield (const struct line *line, const +@@ -1535,10 +1721,10 @@ limfield (const struct line *line, const `beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first `blank' character after the preceding field. */ @@ -2730,7 +2734,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1518,10 +1704,10 @@ limfield (const struct line *line, const +@@ -1584,10 +1770,10 @@ limfield (const struct line *line, const */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -2743,7 +2747,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c if (newlim) lim = newlim; } -@@ -1552,6 +1738,113 @@ limfield (const struct line *line, const +@@ -1618,6 +1804,113 @@ limfield (const struct line *line, const return ptr; } @@ -2857,7 +2861,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/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 -@@ -1634,8 +1927,24 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1700,8 +1993,24 @@ fillbuf (struct buffer *buf, FILE *fp, c else { if (key->skipsblanks) @@ -2884,7 +2888,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c line->keybeg = line_start; } } -@@ -1673,7 +1982,7 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1739,7 +2048,7 @@ fillbuf (struct buffer *buf, FILE *fp, c hideously fast. */ static int @@ -2893,7 +2897,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c { while (blanks[to_uchar (*a)]) a++; -@@ -1782,6 +2091,25 @@ human_numcompare (const char *a, const c +@@ -1848,6 +2157,25 @@ human_numcompare (const char *a, const c : strnumcmp (a, b, decimal_point, thousands_sep)); } @@ -2919,7 +2923,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c static int general_numcompare (const char *sa, const char *sb) { -@@ -1815,7 +2143,7 @@ general_numcompare (const char *sa, cons +@@ -1881,7 +2209,7 @@ general_numcompare (const char *sa, cons Return 0 if the name in S is not recognized. */ static int @@ -2928,7 +2932,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -1996,11 +2324,79 @@ compare_version (char *restrict texta, s +@@ -2062,11 +2390,79 @@ compare_version (char *restrict texta, s return diff; } @@ -3009,7 +3013,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c { struct keyfield *key = keylist; -@@ -2180,6 +2576,179 @@ keycompare (const struct line *a, const +@@ -2246,6 +2642,179 @@ keycompare (const struct line *a, const return key->reverse ? -diff : diff; } @@ -3189,7 +3193,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/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. */ -@@ -3178,7 +3747,7 @@ main (int argc, char **argv) +@@ -3244,7 +3813,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3198,7 +3202,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -3199,6 +3768,27 @@ main (int argc, char **argv) +@@ -3265,6 +3834,27 @@ main (int argc, char **argv) thousands_sep = -1; } @@ -3226,7 +3230,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c have_read_stdin = false; inittables (); -@@ -3459,13 +4049,35 @@ main (int argc, char **argv) +@@ -3536,13 +4126,35 @@ main (int argc, char **argv) case 't': { @@ -3266,7 +3270,7 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c else { /* Provoke with `sort -txx'. Complain about -@@ -3476,9 +4088,12 @@ main (int argc, char **argv) +@@ -3553,9 +4165,12 @@ main (int argc, char **argv) quote (optarg)); } } @@ -3281,10 +3285,10 @@ diff -urNp coreutils-8.0-orig/src/sort.c coreutils-8.0/src/sort.c } break; -diff -urNp coreutils-8.0-orig/src/unexpand.c coreutils-8.0/src/unexpand.c ---- coreutils-8.0-orig/src/unexpand.c 2009-09-29 15:27:54.000000000 +0200 -+++ coreutils-8.0/src/unexpand.c 2009-10-07 10:07:16.000000000 +0200 -@@ -38,11 +38,28 @@ +diff -urNp coreutils-8.5-orig/src/unexpand.c coreutils-8.5/src/unexpand.c +--- coreutils-8.5-orig/src/unexpand.c 2010-01-01 14:06:47.000000000 +0100 ++++ coreutils-8.5/src/unexpand.c 2010-04-26 14:24:33.000000000 +0200 +@@ -39,11 +39,28 @@ #include #include #include @@ -3313,7 +3317,7 @@ diff -urNp coreutils-8.0-orig/src/unexpand.c coreutils-8.0/src/unexpand.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "unexpand" -@@ -102,6 +119,208 @@ static struct option const longopts[] = +@@ -103,6 +120,208 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; @@ -3522,7 +3526,7 @@ diff -urNp coreutils-8.0-orig/src/unexpand.c coreutils-8.0/src/unexpand.c void usage (int status) { -@@ -523,7 +742,12 @@ main (int argc, char **argv) +@@ -524,7 +743,12 @@ main (int argc, char **argv) file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -3536,10 +3540,10 @@ diff -urNp coreutils-8.0-orig/src/unexpand.c coreutils-8.0/src/unexpand.c if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); -diff -urNp coreutils-8.0-orig/src/uniq.c coreutils-8.0/src/uniq.c ---- coreutils-8.0-orig/src/uniq.c 2009-09-23 10:25:44.000000000 +0200 -+++ coreutils-8.0/src/uniq.c 2009-10-07 10:07:16.000000000 +0200 -@@ -22,6 +22,16 @@ +diff -urNp coreutils-8.5-orig/src/uniq.c coreutils-8.5/src/uniq.c +--- coreutils-8.5-orig/src/uniq.c 2010-03-13 16:14:09.000000000 +0100 ++++ coreutils-8.5/src/uniq.c 2010-04-26 14:24:33.000000000 +0200 +@@ -21,6 +21,16 @@ #include #include @@ -3905,18 +3909,18 @@ diff -urNp coreutils-8.0-orig/src/uniq.c coreutils-8.0/src/uniq.c skip_chars = 0; skip_fields = 0; check_chars = SIZE_MAX; -diff -urNp coreutils-8.0-orig/tests/Makefile.am coreutils-8.0/tests/Makefile.am ---- coreutils-8.0-orig/tests/Makefile.am 2009-09-29 16:25:44.000000000 +0200 -+++ coreutils-8.0/tests/Makefile.am 2009-10-07 10:07:16.000000000 +0200 -@@ -208,6 +208,7 @@ TESTS = \ +diff -urNp coreutils-8.5-orig/tests/Makefile.am coreutils-8.5/tests/Makefile.am +--- coreutils-8.5-orig/tests/Makefile.am 2010-04-26 14:24:10.000000000 +0200 ++++ coreutils-8.5/tests/Makefile.am 2010-04-26 14:24:33.000000000 +0200 +@@ -224,6 +224,7 @@ TESTS = \ misc/sort-compress \ misc/sort-continue \ misc/sort-files0-from \ + misc/sort-mb-tests \ misc/sort-merge \ misc/sort-merge-fdlimit \ - misc/sort-rand \ -@@ -452,6 +453,10 @@ TESTS = \ + misc/sort-month \ +@@ -475,6 +476,10 @@ TESTS = \ $(root_tests) pr_data = \ @@ -3927,9 +3931,9 @@ diff -urNp coreutils-8.0-orig/tests/Makefile.am coreutils-8.0/tests/Makefile.am pr/0F \ pr/0FF \ pr/0FFnt \ -diff -urNp coreutils-8.0-orig/tests/misc/cut coreutils-8.0/tests/misc/cut ---- coreutils-8.0-orig/tests/misc/cut 2009-09-21 14:29:33.000000000 +0200 -+++ coreutils-8.0/tests/misc/cut 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/tests/misc/cut coreutils-8.5/tests/misc/cut +--- coreutils-8.5-orig/tests/misc/cut 2010-01-01 14:06:47.000000000 +0100 ++++ coreutils-8.5/tests/misc/cut 2010-04-26 14:24:33.000000000 +0200 @@ -26,7 +26,7 @@ use strict; my $prog = 'cut'; my $try = "Try \`$prog --help' for more information.\n"; @@ -3948,41 +3952,41 @@ diff -urNp coreutils-8.0-orig/tests/misc/cut coreutils-8.0/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}, {ERR=>$no_endpoint}], -diff -urNp coreutils-8.0-orig/tests/misc/mb1.I coreutils-8.0/tests/misc/mb1.I ---- coreutils-8.0-orig/tests/misc/mb1.I 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.0/tests/misc/mb1.I 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/tests/misc/mb1.I coreutils-8.5/tests/misc/mb1.I +--- coreutils-8.5-orig/tests/misc/mb1.I 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.5/tests/misc/mb1.I 2010-04-26 14:24:33.000000000 +0200 @@ -0,0 +1,4 @@ +Apple@10 +Banana@5 +Citrus@20 +Cherry@30 -diff -urNp coreutils-8.0-orig/tests/misc/mb1.X coreutils-8.0/tests/misc/mb1.X ---- coreutils-8.0-orig/tests/misc/mb1.X 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.0/tests/misc/mb1.X 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/tests/misc/mb1.X coreutils-8.5/tests/misc/mb1.X +--- coreutils-8.5-orig/tests/misc/mb1.X 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.5/tests/misc/mb1.X 2010-04-26 14:24:33.000000000 +0200 @@ -0,0 +1,4 @@ +Banana@5 +Apple@10 +Citrus@20 +Cherry@30 -diff -urNp coreutils-8.0-orig/tests/misc/mb2.I coreutils-8.0/tests/misc/mb2.I ---- coreutils-8.0-orig/tests/misc/mb2.I 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.0/tests/misc/mb2.I 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/tests/misc/mb2.I coreutils-8.5/tests/misc/mb2.I +--- coreutils-8.5-orig/tests/misc/mb2.I 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.5/tests/misc/mb2.I 2010-04-26 14:24:33.000000000 +0200 @@ -0,0 +1,4 @@ +Apple@AA10@@20 +Banana@AA5@@30 +Citrus@AA20@@5 +Cherry@AA30@@10 -diff -urNp coreutils-8.0-orig/tests/misc/mb2.X coreutils-8.0/tests/misc/mb2.X ---- coreutils-8.0-orig/tests/misc/mb2.X 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.0/tests/misc/mb2.X 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/tests/misc/mb2.X coreutils-8.5/tests/misc/mb2.X +--- coreutils-8.5-orig/tests/misc/mb2.X 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.5/tests/misc/mb2.X 2010-04-26 14:24:33.000000000 +0200 @@ -0,0 +1,4 @@ +Citrus@AA20@@5 +Cherry@AA30@@10 +Apple@AA10@@20 +Banana@AA5@@30 -diff -urNp coreutils-8.0-orig/tests/misc/sort-mb-tests coreutils-8.0/tests/misc/sort-mb-tests ---- coreutils-8.0-orig/tests/misc/sort-mb-tests 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.0/tests/misc/sort-mb-tests 2009-10-07 10:07:16.000000000 +0200 +diff -urNp coreutils-8.5-orig/tests/misc/sort-mb-tests coreutils-8.5/tests/misc/sort-mb-tests +--- coreutils-8.5-orig/tests/misc/sort-mb-tests 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-8.5/tests/misc/sort-mb-tests 2010-04-26 14:24:33.000000000 +0200 @@ -0,0 +1,58 @@ +#! /bin/sh +case $# in