if (lose || optind < argc)
{
/* Print error message and exit. */
- error (0, 0, "%s: %s", _("extra operand"), argv[optind]);
- print_help (stderr);
+ if (argv[optind])
+ error (0, 0, "%s: %s", _("extra operand"), argv[optind]);
+ emit_try_help ();
+ exit (EXIT_FAILURE);
}
len = mbsrtowcs(NULL, &greeting_msg, 0, NULL);
#define STRNCMP_LIT(s, literal) \
strncmp (s, "" literal "", sizeof (literal) - 1)
+/* Use a macro rather than an inline function, as this references
+ the global program_name, which causes dynamic linking issues
+ in libstdbuf.so on some systems where unused functions
+ are not removed by the linker. */
+#define emit_try_help() \
+ do \
+ { \
+ fprintf (stderr, _("Try '%s --help' for more information.\n"), \
+ program_name); \
+ } \
+ while (0)
+
#endif /* HELLO_SYSTEM_H */