Group :: Sistema/Bibliotecas
RPM: libpopt
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: popt-20020315-alt-poptBadOption.patch
Download
Download
--- popt-20020315/popt.c.orig 2004-05-20 21:19:18 +0400
+++ popt-20020315/popt.c 2004-05-21 15:11:15 +0400
@@ -1136,14 +1136,19 @@
const char * poptBadOption(poptContext con, int flags)
{
- struct optionStackEntry * os = NULL;
+ struct optionStackEntry *os;
- if (con != NULL)
- os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os;
+ if (!con)
+ return NULL;
- /*@-nullderef@*/ /* LCL: os->argv != NULL */
- return (os && os->argv ? os->argv[os->next - 1] : NULL);
- /*@=nullderef@*/
+ os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os;
+ if (!os)
+ return NULL;
+
+ if (con->doExec && con->doExec->argv && !os->nextCharArg && os->next == os->argc)
+ return con->doExec->argv[0];
+
+ return ((os->argv && (os->next > 0)) ? os->argv[os->next - 1] : NULL);
}
const char *const poptStrerror(const int error)