|
|
|
@ -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 <stdio.h>
|
|
|
|
@ -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 <assert.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
@ -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 <stdio.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
@ -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 <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
@ -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 <sys/types.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
@ -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 <getopt.h>
|
|
|
|
@ -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 <config.h>
|
|
|
|
@ -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 <stdio.h>
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
@ -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 <getopt.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
@ -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
|
|
|
|
|