summaryrefslogtreecommitdiff
path: root/src/cut.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-12-19 06:20:51 +0000
committerJim Meyering <jim@meyering.net>1993-12-19 06:20:51 +0000
commit7061c33d7b516ca457126be8c9ff6f6dc19f1919 (patch)
treec3bec0f68d6423a16b79ca6185eac6176b1ab08d /src/cut.c
parent0311e952db41b835fc371c11489ecfcb70d3d8d2 (diff)
downloadcoreutils-7061c33d7b516ca457126be8c9ff6f6dc19f1919.tar.xz
(set_fields): Convert ranges like 3-5,6- into 3-.
Before, this was off-by-two and converted 3-5,4-, but not 3-5,5-
Diffstat (limited to 'src/cut.c')
-rw-r--r--src/cut.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cut.c b/src/cut.c
index 54855cbc2..da32597f4 100644
--- 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