summaryrefslogtreecommitdiffstats
path: root/abs/core/coreutils/coreutils-i18n.patch
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/coreutils/coreutils-i18n.patch')
-rw-r--r--abs/core/coreutils/coreutils-i18n.patch152
1 files changed, 86 insertions, 66 deletions
diff --git a/abs/core/coreutils/coreutils-i18n.patch b/abs/core/coreutils/coreutils-i18n.patch
index 1230c23..626bac0 100644
--- a/abs/core/coreutils/coreutils-i18n.patch
+++ b/abs/core/coreutils/coreutils-i18n.patch
@@ -1,3 +1,26 @@
+diff -urN coreutils-6.12-orig/tests/misc/cut coreutils-6.12/tests/misc/cut
+--- coreutils-6.12-orig/tests/misc/cut 2008-05-17 08:41:11.000000000 +0200
++++ coreutils-6.12/tests/misc/cut 2008-06-02 11:13:08.000000000 +0200
+@@ -26,7 +26,7 @@
+ my $prog = 'cut';
+ my $try = "Try \`$prog --help' for more information.\n";
+ my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
+-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 =
+@@ -140,8 +140,8 @@
+ ['od-overlap5', '-b1-3,1-4', '--output-d=:', {IN=>"abcde\n"}, {OUT=>"abcd\n"}],
+
+ # None of the following invalid ranges provoked an error up to coreutils-6.9.
+- ['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},
+- {ERR=>"$prog: invalid decreasing range\n$try"}],
++ ['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},
++ {ERR=>"$prog: invalid byte, character or field list\n$try"}],
+ ['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}],
--- /dev/null 2007-03-01 09:16:39.219409909 +0000
+++ coreutils-6.8+/tests/misc/sort-mb-tests 2007-03-01 15:08:24.000000000 +0000
@@ -0,0 +1,58 @@
@@ -90,14 +113,14 @@
diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
--- coreutils-6.12-orig/tests/Makefile.am 2008-05-27 13:47:53.000000000 +0200
+++ coreutils-6.12/tests/Makefile.am 2008-06-02 10:06:03.000000000 +0200
-@@ -191,6 +191,7 @@
- misc/shuf \
+@@ -192,6 +192,7 @@
misc/sort \
misc/sort-compress \
+ misc/sort-files0-from \
+ misc/sort-mb-tests \
misc/sort-merge \
misc/sort-rand \
- misc/split-a \
+ misc/sort-version \
@@ -391,6 +392,10 @@
$(root_tests)
@@ -331,7 +354,7 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
error (EXIT_FAILURE, errno, "-");
--- coreutils-6.8+/src/join.c.i18n 2007-01-14 15:41:28.000000000 +0000
+++ coreutils-6.8+/src/join.c 2007-03-01 15:08:24.000000000 +0000
-@@ -23,17 +23,31 @@
+@@ -23,16 +23,30 @@
#include <sys/types.h>
#include <getopt.h>
@@ -347,7 +370,6 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+
#include "system.h"
#include "error.h"
- #include "hard-locale.h"
#include "linebuffer.h"
-#include "memcasecmp.h"
#include "quote.h"
@@ -379,17 +401,8 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+/* The number of bytes used for tab. */
+static size_t tablen = 0;
- static struct option const longopts[] =
- {
-@@ -190,6 +206,8 @@
-
- /* Fill in the `fields' structure in LINE. */
-
-+/* Fill in the `fields' structure in LINE. */
-+
- static void
- xfields (struct line *line)
- {
+ /* If nonzero, check that the input is correctly ordered. */
+ static enum
@@ -199,10 +217,11 @@
if (ptr == lim)
return;
@@ -549,22 +562,10 @@ diff -urN coreutils-6.12-orig/tests/Makefile.am coreutils-6.12/tests/Makefile.am
+ extract_field (line, ptr, lim - ptr);
+}
+#endif
-+
- /* Read a line from FP into LINE and split it into fields.
- Return true if successful. */
-
-@@ -249,6 +410,11 @@
- line->nfields_allocated = 0;
- line->nfields = 0;
- line->fields = NULL;
-+#if HAVE_MBRTOWC
-+ if (MB_CUR_MAX > 1)
-+ xfields_multibyte (line);
-+ else
-+#endif
- xfields (line);
- return true;
- }
++
+ static void
+ freeline (struct line *line)
+ {
@@ -377,11 +601,18 @@
/* Print the join of LINE1 and LINE2. */
@@ -703,7 +704,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
- size_t len2; /* Length of fields to compare. */
+ char *beg[2];
+ char *copy[2];
-+ size_t len[2]; /* Length of fields to compare. */
++ size_t len[2]; /* Length of fields to compare. */
int diff;
+ int i, j;
@@ -830,7 +831,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+ return len[0] - len[1];
}
- /* Check that successive input lines PREV and CURRENT from input file
+ /* Check that successive input lines PREV and CURRENT from input file
--- coreutils-6.8+/src/uniq.c.i18n 2007-01-14 15:41:28.000000000 +0000
+++ coreutils-6.8+/src/uniq.c 2007-03-01 15:08:24.000000000 +0000
@@ -23,6 +23,16 @@
@@ -886,13 +887,13 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
return a pointer to the beginning of the line's field to be compared. */
static char *
--find_field (const struct linebuffer *line)
+-find_field (struct linebuffer const *line)
+find_field_uni (struct linebuffer *line)
{
size_t count;
- char *lp = line->buffer;
+ char const *lp = line->buffer;
@@ -219,6 +245,83 @@
- return lp + i;
+ return line->buffer + i;
}
+#if HAVE_MBRTOWC
@@ -1235,9 +1236,9 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
#define TAB_WIDTH 8
/* The official name of this program (e.g., no `g' prefix). */
-@@ -35,23 +57,44 @@
+@@ -35,20 +57,41 @@
- #define AUTHORS "David MacKenzie"
+ #define AUTHORS proper_name ("David MacKenzie")
+#define FATAL_ERROR(Message) \
+ do \
@@ -1259,9 +1260,6 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+ character_mode,
+};
+
- /* The name this program was run with. */
- char *program_name;
-
+/* The argument shows current mode. (Default: column_mode) */
+static enum operating_mode operating_mode;
+
@@ -1756,7 +1754,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
if (hard_LC_TIME)
{
@@ -1031,6 +1100,64 @@
- #endif
+ xstrtol_fatal (e, oi, c, long_options, s);
}
+#if HAVE_MBRTOWC
@@ -1819,7 +1817,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+
/* Specify the amount of main memory to use when sorting. */
static void
- specify_sort_size (char const *s)
+ specify_sort_size (int oi, char c, char const *s)
@@ -1241,7 +1368,7 @@
by KEY in LINE. */
@@ -1940,7 +1938,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
if (newlim)
lim = newlim;
}
-@@ -1384,6 +1570,107 @@
+@@ -1384,6 +1570,113 @@
return ptr;
}
@@ -1954,6 +1952,9 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+ size_t mblength;
+ mbstate_t state;
+
++ if (echar == 0)
++ eword++; /* skip all of end field. */
++
+ memset (&state, '\0', sizeof(mbstate_t));
+
+ if (tab_length)
@@ -2022,24 +2023,27 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+ }
+# endif
+
-+ /* If we're skipping leading blanks, don't start counting characters
-+ * until after skipping past any leading blanks. */
-+ if (key->skipsblanks)
-+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
-+ ptr += mblength;
++ if (echar != 0)
++ {
++ /* If we're skipping leading blanks, don't start counting characters
++ * until after skipping past any leading blanks. */
++ if (key->skipsblanks)
++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
+
-+ memset (&state, '\0', sizeof(mbstate_t));
++ memset (&state, '\0', sizeof(mbstate_t));
+
-+ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
-+ for (i = 0; i < echar; i++)
-+ {
-+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
++ for (i = 0; i < echar; i++)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
+
-+ if (ptr + mblength > lim)
-+ break;
-+ else
-+ ptr += mblength;
-+ }
++ if (ptr + mblength > lim)
++ break;
++ else
++ ptr += mblength;
++ }
++ }
+
+ return ptr;
+}
@@ -2760,7 +2764,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+
#include "system.h"
#include "error.h"
- #include "hard-locale.h"
+ #include "mbswidth.h"
@@ -324,6 +350,18 @@
#include "strftime.h"
#include "xstrtol.h"
@@ -2865,11 +2869,11 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
line of 1st page printed). */
@@ -696,6 +756,7 @@
-a|COLUMN|-m is a `space' and with the -J option a `tab'. */
- static char *col_sep_string = "";
+ static char *col_sep_string = (char *) "";
static int col_sep_length = 0;
+static int col_sep_width = 0;
- static char *column_separator = " ";
- static char *line_separator = "\t";
+ static char *column_separator = (char *) " ";
+ static char *line_separator = (char *) "\t";
@@ -852,6 +913,13 @@
col_sep_length = (int) strlen (optarg_S);
@@ -2951,7 +2955,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
@@ -1031,7 +1122,7 @@
old_s = false;
/* Reset an additional input of -s, -S dominates -s */
- col_sep_string = "";
+ col_sep_string = bad_cast ("");
- col_sep_length = 0;
+ col_sep_length = col_sep_width = 0;
use_col_separator = true;
@@ -3921,7 +3925,7 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
+ size_t delimlen = 0;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
@@ -770,7 +1090,6 @@
switch (optc)
{
@@ -4043,3 +4047,19 @@ diff -urNp coreutils-6.11-orig/src/join.c coreutils-6.11/src/join.c
}
if (optind == argc)
+diff -urNp coreutils-6.12/src/join.c coreutils-6.12-orig/src/join.c
+--- coreutils-6.12/src/join.c 2008-07-16 14:08:01.000000000 +0200
++++ coreutils-6.12-orig/src/join.c 2008-07-16 14:07:02.000000000 +0200
+@@ -634,6 +634,11 @@ get_line (FILE *fp, struct line *line, i
+ return false;
+ }
+
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ xfields_multibyte (line);
++ else
++#endif
+ xfields (line);
+
+ if (prevline[which - 1])
+