From unknown Sat Aug 16 21:12:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13080 <13080@debbugs.gnu.org> To: bug#13080 <13080@debbugs.gnu.org> Subject: Status: [PATHC] improve error reporting Reply-To: bug#13080 <13080@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:12:50 +0000 retitle 13080 [PATHC] improve error reporting reassign 13080 coreutils submitter 13080 "Alexandru Cojocaru" severity 13080 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 04 11:47:46 2012 Received: (at submit) by debbugs.gnu.org; 4 Dec 2012 16:47:46 +0000 Received: from localhost ([127.0.0.1]:53457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfver-0005x9-AN for submit@debbugs.gnu.org; Tue, 04 Dec 2012 11:47:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46677) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TfuWq-0004Em-5k for submit@debbugs.gnu.org; Tue, 04 Dec 2012 10:35:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfuUL-0000i7-30 for submit@debbugs.gnu.org; Tue, 04 Dec 2012 10:32:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfuUK-0000i0-Vw for submit@debbugs.gnu.org; Tue, 04 Dec 2012 10:32:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfuUD-0004Mj-IA for bug-coreutils@gnu.org; Tue, 04 Dec 2012 10:32:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfuU5-0000ct-Lr for bug-coreutils@gnu.org; Tue, 04 Dec 2012 10:32:41 -0500 Received: from mailout-eu.gmx.com ([213.165.64.42]:38596) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TfuU5-0000cI-CO for bug-coreutils@gnu.org; Tue, 04 Dec 2012 10:32:33 -0500 Received: (qmail 5252 invoked by uid 0); 4 Dec 2012 15:32:28 -0000 Received: from 151.65.149.48 by rms-eu007 with HTTP Content-Type: text/plain; charset="utf-8" Date: Tue, 04 Dec 2012 16:32:27 +0100 From: "Alexandru Cojocaru" Message-ID: <20121204153227.48230@gmx.com> MIME-Version: 1.0 Subject: [PATHC] improve error reporting To: bug-coreutils@gnu.org X-Authenticated: #130707387 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: 3HLMcLNzeSEqIdoMoXMhUmd+IGRvb4Bx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 04 Dec 2012 11:47:44 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) >From 8ecd92b3c11abc5cde184f0c511cd469190511af Mon Sep 17 00:00:00 2001 From: Cojocaru Alexandru Date: Tue, 4 Dec 2012 16:08:42 +0100 Subject: [PATCH] cut: improve error reporting * src/cut.c (main): Report error on `-d '' -b1' * src/cut.c (set_fields): Change the error message when the given list is invalid. --- src/cut.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cut.c b/src/cut.c index 4219d24..d55da51 100644 --- a/src/cut.c +++ b/src/cut.c @@ -365,7 +365,7 @@ set_fields (const char *fieldstr)           in_digits = false;           /* Starting a range. */           if (dash_found) -            FATAL_ERROR (_("invalid byte or field list")); +            FATAL_ERROR (_("invalid byte, character or field list"));           dash_found = true;           fieldstr++; @@ -491,7 +491,7 @@ set_fields (const char *fieldstr)           fieldstr++;         }       else -        FATAL_ERROR (_("invalid byte or field list")); +        FATAL_ERROR (_("invalid byte, character or field list"));     }   max_range_endpoint = 0; @@ -781,7 +781,7 @@ main (int argc, char **argv)   /* By default, all non-delimited lines are printed.  */   suppress_non_delimited = false; -  delim = '\0'; +  delim = 0x7F + 1;   have_read_stdin = false;   while ((optc = getopt_long (argc, argv, "b:c:d:f:ns", longopts, NULL)) != -1) @@ -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 != 0x7F + 1 && operating_mode != field_mode)     FATAL_ERROR (_("an input delimiter may be specified only\  when operating on fields")); -- 1.8.0.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 04 20:57:35 2012 Received: (at 13080-done) by debbugs.gnu.org; 5 Dec 2012 01:57:35 +0000 Received: from localhost ([127.0.0.1]:53889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg4Ev-0003Rj-P4 for submit@debbugs.gnu.org; Tue, 04 Dec 2012 20:57:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56195) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg4Et-0003Rb-Ia for 13080-done@debbugs.gnu.org; Tue, 04 Dec 2012 20:57:32 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB51vPq1000373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Dec 2012 20:57:25 -0500 Received: from [10.36.116.48] (ovpn-116-48.ams2.redhat.com [10.36.116.48]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB51vNUN026566 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 4 Dec 2012 20:57:24 -0500 Message-ID: <50BEAA02.4060209@draigBrady.com> Date: Wed, 05 Dec 2012 01:57:22 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Alexandru Cojocaru Subject: Re: bug#13080: [PATHC] improve error reporting References: <20121204153227.48230@gmx.com> In-Reply-To: <20121204153227.48230@gmx.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qB51vPq1000373 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13080-done Cc: 13080-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On 12/04/2012 03:32 PM, Alexandru Cojocaru wrote: >>>From 8ecd92b3c11abc5cde184f0c511cd469190511af Mon Sep 17 00:00:00 2001 > From: Cojocaru Alexandru > Date: Tue, 4 Dec 2012 16:08:42 +0100 > Subject: [PATCH] cut: improve error reporting > > * src/cut.c (main): Report error on `-d '' -b1' > > * src/cut.c (set_fields): Change the error message when > the given list is invalid. > --- > src/cut.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/cut.c b/src/cut.c > index 4219d24..d55da51 100644 > --- a/src/cut.c > +++ b/src/cut.c > @@ -365,7 +365,7 @@ set_fields (const char *fieldstr) > in_digits =3D false; > /* Starting a range. */ > if (dash_found) > - FATAL_ERROR (_("invalid byte or field list")); > + FATAL_ERROR (_("invalid byte, character or field list")); > dash_found =3D true; > fieldstr++; > > @@ -491,7 +491,7 @@ set_fields (const char *fieldstr) > fieldstr++; > } > else > - FATAL_ERROR (_("invalid byte or field list")); > + FATAL_ERROR (_("invalid byte, character or field list")); > } > > max_range_endpoint =3D 0; The above is fine. > @@ -781,7 +781,7 @@ main (int argc, char **argv) > /* By default, all non-delimited lines are printed. */ > suppress_non_delimited =3D false; > > - delim =3D '\0'; > + delim =3D 0x7F + 1; > have_read_stdin =3D false; > > while ((optc =3D getopt_long (argc, argv, "b:c:d:f:ns", longopts, N= ULL)) !=3D -1) > @@ -846,7 +846,7 @@ main (int argc, char **argv) > if (operating_mode =3D=3D undefined_mode) > FATAL_ERROR (_("you must specify a list of bytes, characters, or = fields")); > > - if (delim !=3D '\0' && operating_mode !=3D field_mode) > + if (delim !=3D 0x7F + 1 && operating_mode !=3D field_mode) > FATAL_ERROR (_("an input delimiter may be specified only\ > when operating on fields")); 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 =3D=3D undefined_mode) FATAL_ERROR (_("you must specify a list of bytes, characters, or fi= elds")); - if (delim !=3D '\0' && operating_mode !=3D field_mode) + if (delim_specified && operating_mode !=3D field_mode) FATAL_ERROR (_("an input delimiter may be specified only\ when operating on fields")); thanks, P=C3=A1draig. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 05 08:55:49 2012 Received: (at 13080) by debbugs.gnu.org; 5 Dec 2012 13:55:49 +0000 Received: from localhost ([127.0.0.1]:54455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TgFRy-0007ex-Oa for submit@debbugs.gnu.org; Wed, 05 Dec 2012 08:55:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18390) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TgFRv-0007en-Nm for 13080@debbugs.gnu.org; Wed, 05 Dec 2012 08:55:45 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB5DtZKn018530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Dec 2012 08:55:35 -0500 Received: from [10.36.116.68] (ovpn-116-68.ams2.redhat.com [10.36.116.68]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB5DtWSA005505 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 5 Dec 2012 08:55:34 -0500 Message-ID: <50BF5254.7000300@draigBrady.com> Date: Wed, 05 Dec 2012 13:55:32 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: 13080@debbugs.gnu.org, cojocaru_alexandru@gmx.com Subject: Re: bug#13080: [PATHC] improve error reporting References: <20121204153227.48230@gmx.com> <50BEAA02.4060209@draigBrady.com> In-Reply-To: <50BEAA02.4060209@draigBrady.com> Content-Type: multipart/mixed; boundary="------------050001030001060108090900" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 13080 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) This is a multi-part message in MIME format. --------------050001030001060108090900 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qB5DtZKn018530 On 12/05/2012 01:57 AM, P=C3=A1draig 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 =3D=3D undefined_mode) > FATAL_ERROR (_("you must specify a list of bytes, characters, or = fields")); > > - if (delim !=3D '\0' && operating_mode !=3D field_mode) > + if (delim_specified && operating_mode !=3D 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=C3=A1draig. --------------050001030001060108090900 Content-Type: text/x-patch; name="cut-d-nul.diff" Content-Disposition: attachment; filename="cut-d-nul.diff" Content-Transfer-Encoding: 7bit >From 4cf194b4f1e425973f2d226905f49649e904a0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= 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 --------------050001030001060108090900-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 05 09:30:44 2012 Received: (at 13080) by debbugs.gnu.org; 5 Dec 2012 14:30:48 +0000 Received: from localhost ([127.0.0.1]:54495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TgFzU-0008QU-R0 for submit@debbugs.gnu.org; Wed, 05 Dec 2012 09:30:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15269) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TgFz4-0008PR-N1 for 13080@debbugs.gnu.org; Wed, 05 Dec 2012 09:30:07 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB5ETn8X004359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Dec 2012 09:29:49 -0500 Received: from [10.36.116.68] (ovpn-116-68.ams2.redhat.com [10.36.116.68]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qB5ETlkB022140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Dec 2012 09:29:48 -0500 Message-ID: <50BF5A5B.8010202@draigBrady.com> Date: Wed, 05 Dec 2012 14:29:47 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: 13080@debbugs.gnu.org, cojocaru_alexandru@gmx.com Subject: Re: bug#13080: [PATHC] improve error reporting References: <20121204153227.48230@gmx.com> <50BEAA02.4060209@draigBrady.com> <50BF5254.7000300@draigBrady.com> In-Reply-To: <50BF5254.7000300@draigBrady.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qB5ETn8X004359 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13080 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On 12/05/2012 01:55 PM, P=C3=A1draig Brady wrote: > On 12/05/2012 01:57 AM, P=C3=A1draig 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 =3D=3D undefined_mode) >> FATAL_ERROR (_("you must specify a list of bytes, characters, or= fields")); >> >> - if (delim !=3D '\0' && operating_mode !=3D field_mode) >> + if (delim_specified && operating_mode !=3D 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. The previous mail omitted the following patch. sorry, P=C3=A1draig. From b95a20224e40dd5e2d9eb3f0611e1db51b6f4e04 Mon Sep 17 00:00:00 2001 From: Cojocaru Alexandru Date: Wed, 5 Dec 2012 13:13:51 +0000 Subject: [PATCH 1/2] cut: improve error reporting * src/cut.c (main): Treat a NUL delimiter (-d '') consistently with non NUL delimiters, and disallow such a delimiter option, unless a field is also specified. (set_fields): Provide a more accurate error message when a given list is invalid. * tests/misc/cut.pl: Add a test case. --- src/cut.c | 6 +++--- tests/misc/cut.pl | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/cut.c b/src/cut.c index 4219d24..dc83072 100644 --- a/src/cut.c +++ b/src/cut.c @@ -365,7 +365,7 @@ set_fields (const char *fieldstr) in_digits =3D false; /* Starting a range. */ if (dash_found) - FATAL_ERROR (_("invalid byte or field list")); + FATAL_ERROR (_("invalid byte, character or field list")); dash_found =3D true; fieldstr++; @@ -491,7 +491,7 @@ set_fields (const char *fieldstr) fieldstr++; } else - FATAL_ERROR (_("invalid byte or field list")); + FATAL_ERROR (_("invalid byte, character or field list")); } max_range_endpoint =3D 0; @@ -846,7 +846,7 @@ main (int argc, char **argv) if (operating_mode =3D=3D undefined_mode) FATAL_ERROR (_("you must specify a list of bytes, characters, or fi= elds")); - if (delim !=3D '\0' && operating_mode !=3D field_mode) + if (delim_specified && operating_mode !=3D field_mode) FATAL_ERROR (_("an input delimiter may be specified only\ when operating on fields")); diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl index 27768ff..aff0cbe 100755 --- a/tests/misc/cut.pl +++ b/tests/misc/cut.pl @@ -32,6 +32,8 @@ my $try =3D "Try '$prog --help' for more information.\n= "; my $from_1 =3D "$prog: fields and positions are numbered from 1\n$try"; my $inval =3D "$prog: invalid byte or field list\n$try"; my $no_endpoint =3D "$prog: invalid range with no endpoint: -\n$try"; +my $nofield =3D "$prog: an input delimiter may be specified only when " . + "operating on fields\n$try"; my @Tests =3D ( @@ -118,6 +120,11 @@ my @Tests =3D ['multichar-od', qw(-d: --out=3D_._), '-f2,3', {IN=3D>"a:b:c\n"}, {OUT=3D>"b_._c\n"}], + # Ensure delim is not allowed without a field + # Prior to 8.21, a NUL delim was allowed without a field + ['delim-no-field1', qw(-d ''), '-b1', {EXIT=3D>1}, {ERR=3D>$nofield}], + ['delim-no-field2', qw(-d:), '-b1', {EXIT=3D>1}, {ERR=3D>$nofield}], + # Prior to 1.22i, you couldn't use a delimiter that would sign-extend. ['8bit-delim', '-d', "\255", '--out=3D_', '-f2,3', {IN=3D>"a\255b\255= c\n"}, {OUT=3D>"b_c\n"}], --=20 1.7.6.4 From unknown Sat Aug 16 21:12:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 03 Jan 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator