On 12/05/2012 01:57 AM, Pádraig Brady wrote:

Keying on 0x80 doesn't seem right.
I'll apply this hunk instead in your name.
Please confirm.

diff --git a/src/cut.c b/src/cut.c
index 4219d24..f2e63dc 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -846,7 +846,7 @@ main (int argc, char **argv)
    if (operating_mode == undefined_mode)
      FATAL_ERROR (_("you must specify a list of bytes, characters, or 
fields"));

-  if (delim != '\0' && operating_mode != field_mode)
+  if (delim_specified && operating_mode != field_mode)
      FATAL_ERROR (_("an input delimiter may be specified only\
   when operating on fields"));

I got confirmation of the adjustment privately,
so I'm going to push the attached two patches,
which augment/adjust the cut test accordingly.

thanks,
Pádraig.
>From 4cf194b4f1e425973f2d226905f49649e904a0e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Wed, 5 Dec 2012 13:51:01 +0000
Subject: [PATCH] tests: cut.pl: adjust for changed diagnostic

* tests/misc/cut.pl: Since we now output the more
complete error message irrespective of running
in a multi-byte locale or not, adjust the test accordingly.
---
 tests/misc/cut.pl |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl
index aff0cbe..a402a75 100755
--- a/tests/misc/cut.pl
+++ b/tests/misc/cut.pl
@@ -30,7 +30,7 @@ my $mb_locale = $ENV{LOCALE_FR_UTF8};
 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 $nofield = "$prog: an input delimiter may be specified only when " .
               "operating on fields\n$try";
@@ -195,18 +195,6 @@ if ($mb_locale ne 'C')
         my @new_t = @$t;
         my $test_name = shift @new_t;
 
-        # Depending on whether cut is multi-byte-patched,
-        # it emits different diagnostics:
-        #   non-MB: invalid byte or field list
-        #   MB:     invalid byte, character or field list
-        # Adjust the expected error output accordingly.
-        if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval}
-            (@new_t))
-          {
-            my $sub = {ERR_SUBST => 's/, character//'};
-            push @new_t, $sub;
-            push @$t, $sub;
-          }
         push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}];
       }
     push @Tests, @new;
-- 
1.7.6.4

Reply via email to