aboutsummaryrefslogtreecommitdiff
path: root/coreutils/cut.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/cut.c')
-rw-r--r--coreutils/cut.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index f4cf5401b..3abebe7ad 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -243,6 +243,16 @@ static void cut_file(FILE *file, const char *delim, const char *odelim,
243 start = next; 243 start = next;
244 continue; 244 continue;
245 } 245 }
246 /* -F N-M preserves intermediate delimiters: */
247 //printf "1 2 3 4 5 6 7\n" | toybox cut -O: -F2,4-6,7
248 //2:4 5 6:7
249 if (opt_REGEX && dcount <= cut_list[cl_pos].endpos)
250 continue;
251// NB: toybox does the above for -f too, but it's a compatibility bug:
252//printf "1 2 3 4 5 6 7 8\n" | toybox cut -d' ' -O: -f2,4-6,7
253//2:4 5 6:7 // WRONG!
254//printf "1 2 3 4 5 6 7 8\n" | cut -d' ' --output-delimiter=: -f2,4-6,7
255//2:4:5:6:7 // GNU coreutils 9.1
246 } 256 }
247#if ENABLE_FEATURE_CUT_REGEX 257#if ENABLE_FEATURE_CUT_REGEX
248 if (end != start || !opt_REGEX) 258 if (end != start || !opt_REGEX)