Fix the i18n path in cut.c

This commit is contained in:
Ondřej Vašík 2013-12-15 09:05:15 +01:00
parent bb33bc40ad
commit a1f9baa6b8
2 changed files with 9 additions and 27 deletions

View File

@ -9,22 +9,3 @@ diff -urNp coreutils-8.22-orig/tests/df/df-symlink.sh coreutils-8.22/tests/df/df
disk=$(df --out=source '.' | tail -n1) ||
skip_ "cannot determine '.' file system"
diff -urNp coreutils-8.22-orig/tests/misc/cut.pl coreutils-8.22/tests/misc/cut.pl
--- coreutils-8.22-orig/tests/misc/cut.pl 2013-12-14 18:18:58.707172051 +0100
+++ coreutils-8.22/tests/misc/cut.pl 2013-12-14 18:22:14.931010910 +0100
@@ -23,11 +23,11 @@ use strict;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
-my $mb_locale;
+my $mb_locale = 'C';
# uncommented enable multibyte paths
-$mb_locale = $ENV{LOCALE_FR_UTF8};
-! defined $mb_locale || $mb_locale eq 'none'
- and $mb_locale = 'C';
+#$mb_locale = $ENV{LOCALE_FR_UTF8};
+#! defined $mb_locale || $mb_locale eq 'none'
+# and $mb_locale = 'C';
my $prog = 'cut';
my $try = "Try '$prog --help' for more information.\n";

View File

@ -219,20 +219,20 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
+ putchar ('\n');
+ idx = 0;
+ print_delimiter = false;
+ current_rp = rp;
+ }
+ else
+ {
+ next_item (&idx);
+ bool range_start;
+ bool *rs = output_delimiter_specified ? &range_start : NULL;
+ idx += (operating_mode == byte_mode) ? mblength : 1;
+ //idx += (operating_mode == byte_mode) ? mblength : 1;
+ if (print_kth (idx))
+ {
+ if (rs && *rs && print_delimiter)
+ if (output_delimiter_specified)
+ {
+ fwrite (output_delimiter_string, sizeof (char),
+ output_delimiter_length, stdout);
+ }
+ if (print_delimiter && is_range_start_index (idx))
+ fwrite (output_delimiter_string, sizeof (char),
+ output_delimiter_length, stdout);
+ }
+ print_delimiter = true;
+ fwrite (bufpos, mblength, sizeof(char), stdout);
+ }
@ -247,7 +247,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
/* Read from stream STREAM, printing to standard output any selected fields. */
static void
@@ -629,13 +782,197 @@ cut_fields (FILE *stream)
@@ -629,13 +782,198 @@ cut_fields (FILE *stream)
}
}
@ -401,6 +401,7 @@ diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
+ if (wc == WEOF)
+ break;
+ field_idx = 1;
+ current_rp = rp;
+ found_any_selected_field = 0;
+ }
+ }