Subject: [PATHC] improve error reporting
From: "Alexandru Cojocaru" <[email-masked]>
To: [email-masked]
Date: Tue, 04 Dec 2012 16:32:27 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

From 8ecd92b3c11abc5cde184f0c511cd469190511af Mon Sep 17 00:00:00 2001
From: Cojocaru Alexandru <[email-masked]>
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