(set_fields): Convert ranges like 3-5,6- into 3-.
authorJim Meyering <jim@meyering.net>
Sun, 19 Dec 1993 06:20:51 +0000 (06:20 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 19 Dec 1993 06:20:51 +0000 (06:20 +0000)
Before, this was off-by-two and converted 3-5,4-, but not 3-5,5-

src/cut.c

index 54855cb..da32597 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -353,9 +353,11 @@ set_fields (fieldstr)
                          /* No, the new sequence starts before the
                             old.  Does the old range going to end of line
                             extend into the new range?  */
-                         if (eol_range_start < value)
+                         if (value >= eol_range_start - 1)
+                           {
                            /* Yes.  Simply move the end of line marker. */
                            eol_range_start = initial;
+                           }
                          else
                            {
                              /* No.  A simple range, before and disjoint from