GNU bug report logs -
#13080
[PATHC] improve error reporting
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#13080: [PATHC] improve error reporting
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 13080 <at> debbugs.gnu.org.
--
13080: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13080
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
On 12/04/2012 03:32 PM, Alexandru Cojocaru wrote:
>>From 8ecd92b3c11abc5cde184f0c511cd469190511af Mon Sep 17 00:00:00 2001
> From: Cojocaru Alexandru <xojoc <at> gmx.com>
> 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;
The above is fine.
> @@ -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"));
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"));
thanks,
Pádraig.
[Message part 3 (message/rfc822, inline)]
From 8ecd92b3c11abc5cde184f0c511cd469190511af Mon Sep 17 00:00:00 2001
From: Cojocaru Alexandru <xojoc <at> gmx.com>
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
This bug report was last modified 12 years and 228 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.