coreutils-i18n.patch: synchronize the patch with openSUSE
This commit is contained in:
parent
59649f0733
commit
97967f71c8
|
@ -14,7 +14,7 @@ Subject: [PATCH] coreutils-i18n.patch
|
||||||
src/expand-common.c | 114 ++++++
|
src/expand-common.c | 114 ++++++
|
||||||
src/expand-common.h | 12 +
|
src/expand-common.h | 12 +
|
||||||
src/expand.c | 90 ++++-
|
src/expand.c | 90 ++++-
|
||||||
src/fold.c | 309 +++++++++++++--
|
src/fold.c | 312 +++++++++++++--
|
||||||
src/join.c | 359 ++++++++++++++---
|
src/join.c | 359 ++++++++++++++---
|
||||||
src/local.mk | 4 +-
|
src/local.mk | 4 +-
|
||||||
src/pr.c | 443 +++++++++++++++++++--
|
src/pr.c | 443 +++++++++++++++++++--
|
||||||
|
@ -35,7 +35,7 @@ Subject: [PATCH] coreutils-i18n.patch
|
||||||
tests/misc/uniq.pl | 55 +++
|
tests/misc/uniq.pl | 55 +++
|
||||||
tests/pr/pr-tests.pl | 49 +++
|
tests/pr/pr-tests.pl | 49 +++
|
||||||
tests/unexpand/mb.sh | 172 ++++++++
|
tests/unexpand/mb.sh | 172 ++++++++
|
||||||
31 files changed, 3637 insertions(+), 213 deletions(-)
|
31 files changed, 3640 insertions(+), 213 deletions(-)
|
||||||
create mode 100644 lib/mbfile.c
|
create mode 100644 lib/mbfile.c
|
||||||
create mode 100644 lib/mbfile.h
|
create mode 100644 lib/mbfile.h
|
||||||
create mode 100644 m4/mbfile.m4
|
create mode 100644 m4/mbfile.m4
|
||||||
|
@ -545,7 +545,7 @@ index cdf33d8..b8301d7 100644
|
||||||
+static void
|
+static void
|
||||||
+cut_characters_or_cut_bytes_no_split (FILE *stream)
|
+cut_characters_or_cut_bytes_no_split (FILE *stream)
|
||||||
+{
|
+{
|
||||||
+ uintmax_t idx; /* number of bytes or characters in the line so far. */
|
+ uintmax_t idx; /* number of bytes or characters in the line so far. */
|
||||||
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
|
||||||
+ char *bufpos; /* Next read position of BUF. */
|
+ char *bufpos; /* Next read position of BUF. */
|
||||||
+ size_t buflen; /* The length of the byte sequence in buf. */
|
+ size_t buflen; /* The length of the byte sequence in buf. */
|
||||||
|
@ -1412,7 +1412,7 @@ index 94a6d37..a278783 100644
|
||||||
/* Look for the last blank. */
|
/* Look for the last blank. */
|
||||||
while (logical_end)
|
while (logical_end)
|
||||||
{
|
{
|
||||||
@@ -215,13 +252,222 @@ fold_file (char const *filename, size_t width)
|
@@ -215,13 +252,225 @@ fold_file (char const *filename, size_t width)
|
||||||
line_out[offset_out++] = c;
|
line_out[offset_out++] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1510,38 +1510,39 @@ index 94a6d37..a278783 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+rescan:
|
+rescan:
|
||||||
+ if (convfail)
|
+ if (operating_mode == byte_mode) /* byte mode */
|
||||||
+ increment = 1;
|
|
||||||
+ else if (wc == L'\n')
|
|
||||||
+ {
|
|
||||||
+ /* preserve newline */
|
|
||||||
+ fwrite (line_out, sizeof(char), offset_out, stdout);
|
|
||||||
+ START_NEW_LINE;
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ else if (operating_mode == byte_mode) /* byte mode */
|
|
||||||
+ increment = mblength;
|
+ increment = mblength;
|
||||||
+ else if (operating_mode == character_mode) /* character mode */
|
+ else if (operating_mode == character_mode) /* character mode */
|
||||||
+ increment = 1;
|
+ increment = 1;
|
||||||
+ else /* column mode */
|
+ else /* column mode */
|
||||||
+ {
|
+ {
|
||||||
+ switch (wc)
|
+ if (convfail)
|
||||||
|
+ increment = 1;
|
||||||
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ case L'\b':
|
+ switch (wc)
|
||||||
+ increment = (column > 0) ? -1 : 0;
|
+ {
|
||||||
+ break;
|
+ case L'\n':
|
||||||
|
+ fwrite (line_out, sizeof(char), offset_out, stdout);
|
||||||
|
+ START_NEW_LINE;
|
||||||
|
+ continue;
|
||||||
+
|
+
|
||||||
+ case L'\r':
|
+ case L'\b':
|
||||||
+ increment = -1 * column;
|
+ increment = (column > 0) ? -1 : 0;
|
||||||
+ break;
|
+ break;
|
||||||
+
|
+
|
||||||
+ case L'\t':
|
+ case L'\r':
|
||||||
+ increment = 8 - column % 8;
|
+ increment = -1 * column;
|
||||||
+ break;
|
+ break;
|
||||||
+
|
+
|
||||||
+ default:
|
+ case L'\t':
|
||||||
+ increment = wcwidth (wc);
|
+ increment = 8 - column % 8;
|
||||||
+ increment = (increment < 0) ? 0 : increment;
|
+ break;
|
||||||
|
+
|
||||||
|
+ default:
|
||||||
|
+ increment = wcwidth (wc);
|
||||||
|
+ increment = (increment < 0) ? 0 : increment;
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -1595,6 +1596,8 @@ index 94a6d37..a278783 100644
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ *saved_errno = errno;
|
+ *saved_errno = errno;
|
||||||
|
+ if (!ferror (istream))
|
||||||
|
+ *saved_errno = 0;
|
||||||
+
|
+
|
||||||
+ if (offset_out)
|
+ if (offset_out)
|
||||||
+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
|
+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
|
||||||
|
@ -1637,7 +1640,7 @@ index 94a6d37..a278783 100644
|
||||||
if (STREQ (filename, "-"))
|
if (STREQ (filename, "-"))
|
||||||
clearerr (istream);
|
clearerr (istream);
|
||||||
else if (fclose (istream) != 0 && !saved_errno)
|
else if (fclose (istream) != 0 && !saved_errno)
|
||||||
@@ -252,7 +498,8 @@ main (int argc, char **argv)
|
@@ -252,7 +501,8 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
atexit (close_stdout);
|
atexit (close_stdout);
|
||||||
|
|
||||||
|
@ -1647,7 +1650,7 @@ index 94a6d37..a278783 100644
|
||||||
|
|
||||||
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
|
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
|
||||||
{
|
{
|
||||||
@@ -261,7 +508,15 @@ main (int argc, char **argv)
|
@@ -261,7 +511,15 @@ main (int argc, char **argv)
|
||||||
switch (optc)
|
switch (optc)
|
||||||
{
|
{
|
||||||
case 'b': /* Count bytes rather than columns. */
|
case 'b': /* Count bytes rather than columns. */
|
||||||
|
@ -3299,7 +3302,7 @@ index 5f4c817..bd9c672 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
+#if HAVE_MBRTOWC
|
+#if HAVE_MBRTOWC
|
||||||
+static char *
|
+static char * _GL_ATTRIBUTE_PURE
|
||||||
+limfield_mb (const struct line *line, const struct keyfield *key)
|
+limfield_mb (const struct line *line, const struct keyfield *key)
|
||||||
+{
|
+{
|
||||||
+ char *ptr = line->text, *lim = ptr + line->length - 1;
|
+ char *ptr = line->text, *lim = ptr + line->length - 1;
|
||||||
|
|
Loading…
Reference in New Issue