← Commit list

e2304d47a

Denys Vlasenko
Denys Vlasenko
2024-12-16
SUCCESS Duration: 159s

Subject

cut: shorten error messages on bad syntax even more

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/cut.c+6 -10
@@ -330,16 +330,12 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
/* non-field (char or byte) cutting has some special handling */
if (!(opt & (OPT_FIELDS|OPT_REGEX))) {
- static const char _op_on_field[] ALIGN1 = " makes sense only with -f"IF_FEATURE_CUT_REGEX(" or -F");
-
- if (opt & OPT_SUPPRESS) {
- bb_error_msg_and_die
- ("-s%s", _op_on_field);
- }
- if (opt & OPT_DELIM) {
- bb_error_msg_and_die
- ("-d DELIM%s", _op_on_field);
- }
+ static const char requires_f[] ALIGN1 = " requires -f"
+ IF_FEATURE_CUT_REGEX(" or -F");
+ if (opt & OPT_SUPPRESS)
+ bb_error_msg_and_die("-s%s", requires_f);
+ if (opt & OPT_DELIM)
+ bb_error_msg_and_die("-d DELIM%s", requires_f);
}
/*