From: Jim Meyering Date: Sun, 19 Dec 1993 06:20:51 +0000 (+0000) Subject: (set_fields): Convert ranges like 3-5,6- into 3-. X-Git-Tag: textutils-1_12_1~793 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7061c33d7b516ca457126be8c9ff6f6dc19f1919;p=thirdparty%2Fcoreutils.git (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- --- diff --git a/src/cut.c b/src/cut.c index 54855cbc29..da32597f47 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