diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2024-12-20 22:12:33 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-12-20 22:12:33 +0100 |
commit | b03f5162ac239c3743cfac246b3760b0020f4d23 (patch) | |
tree | f8962ca3b8485d4ef787b4b23e8fb5c67d811003 /coreutils/cut.c | |
parent | dd40b40ee59e1eae6a70265741657bc55d960cce (diff) | |
download | busybox-w32-b03f5162ac239c3743cfac246b3760b0020f4d23.tar.gz busybox-w32-b03f5162ac239c3743cfac246b3760b0020f4d23.tar.bz2 busybox-w32-b03f5162ac239c3743cfac246b3760b0020f4d23.zip |
cut: fix up -D/-s behavior with -F
function old new delta
cut_main 1388 1402 +14
packed_usage 34934 34933 -1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-1) Total: 13 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/cut.c')
-rw-r--r-- | coreutils/cut.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c index a766db40f..65e0e5c30 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -43,7 +43,7 @@ | |||
43 | //usage: "\n -F LIST Print only these fields (-d is regex)" | 43 | //usage: "\n -F LIST Print only these fields (-d is regex)" |
44 | //usage: ) | 44 | //usage: ) |
45 | //usage: "\n -s Drop lines with no delimiter (else print them in full)" | 45 | //usage: "\n -s Drop lines with no delimiter (else print them in full)" |
46 | //usage: "\n -D Don't sort/collate sections or match -f"IF_FEATURE_CUT_REGEX("F")" lines without delimeter" | 46 | //usage: "\n -D Don't sort ranges; line without delimiters has one field" |
47 | //usage: IF_LONG_OPTS( | 47 | //usage: IF_LONG_OPTS( |
48 | //usage: "\n --output-delimiter SEP Output field delimeter" | 48 | //usage: "\n --output-delimiter SEP Output field delimeter" |
49 | //usage: ) IF_NOT_LONG_OPTS( | 49 | //usage: ) IF_NOT_LONG_OPTS( |
@@ -202,8 +202,8 @@ static void cut_file(FILE *file, const char *delim, const char *odelim, | |||
202 | /* End of current line? */ | 202 | /* End of current line? */ |
203 | if (next == linelen) { | 203 | if (next == linelen) { |
204 | end = linelen; /* print up to end */ | 204 | end = linelen; /* print up to end */ |
205 | /* If we've seen no delimiters, check -s */ | 205 | /* If we've seen no delimiters, and no -D, check -s */ |
206 | if (cl_pos == 0 && dcount == 0 && !opt_REGEX) { | 206 | if (!(option_mask32 & OPT_NOSORT) && cl_pos == 0 && dcount == 0) { |
207 | if (option_mask32 & OPT_SUPPRESS) | 207 | if (option_mask32 & OPT_SUPPRESS) |
208 | goto next_line; | 208 | goto next_line; |
209 | /* else: will print entire line */ | 209 | /* else: will print entire line */ |