The yes utility, when operating without POSIXLY_CORRECT set, cannot print
a literal "--version" or "--help" as its output since the usual long
option escape sequence "--" isn't recognised. For example :

yes --version

prints the version

yes -- --version

repeatedly prints "-- --version"

POSIXLY_CORRECT=1 yes --version

gives the desired behaviour.

Fixing this should be as simple as adding the code 

  if (argc > 1 && STREQ (argv[1], "--"))
    {
      --argc;
      ++argv;
    }

used elsewhere in the sh-utils to implement the "--" option.

This is of course only a bug in the sense of the goal of GNU software
avoiding arbitrary limits.

This behaviour is found with sh-utils 2.0j (from alpha.gnu.org) and 2.0
(as shipped with RedHat 6.2).

 - Callum McKenzie

Reply via email to