Description of problem: poptPrintUsage() prints the short options multiple times if the options table uses POPT_ARG_INCLUDE_TABLE. Version-Release number of selected component (if applicable): rpm-4.4.2-15.2 How reproducible: Every time. Steps to Reproduce: 1. rpm --usage | head -n1 Actual results: Usage: rpm [-aKfgpWHqV] [-aKfgpWHqVcdils] [-aKfgpWHqVcdilsaKfgpWHqV] [-aKfgpWHqVcdilsaKfgpWHqV] [-aKfgpWHqVcdilsaKfgpWHqV] [-aKfgpWHqVcdilsaKfgpWHqVK] [-aKfgpWHqVcdilsaKfgpWHqVK] [-aKfgpWHqVcdilsaKfgpWHqVKi] [-aKfgpWHqVcdilsaKfgpWHqVKiv] [-aKfgpWHqVcdilsaKfgpWHqVKiv] [-aKfgpWHqVcdilsaKfgpWHqVKiv?] [-a|--all] [-f|--file] [-g|--group] Expected results: Usage: rpm [-aKfgpWHqVcdilsaKfgpWHqVKiv?] [-a|--all] [-f|--file] [-g|--group] Additional info: Every option table included into the main table via POPT_ARG_INCLUDE_TABLE causes another [-asdfljl] string to be printed with all the short options defined so far. This behaviour is not restricted to rpm on Fedora, it has also been confirmed on rpm on Suse and the new gphoto2 code in SVN.
Test case: http://es.lauft.net/popt-usage-test/
Fixed in CVS, will be in popt-1.10.7 when released. @@ -775,7 +775,7 @@ static int showShortOptions(const struct /*@=boundswrite@*/ /* On return to top level, print the short options, return print length. */ - if (s == str && *s != '\0') { + if (s != str && *s != '\0') { fprintf(fp, " [-%s]", s); len = strlen(s) + sizeof(" [-]")-1; }